About webmull

This author has not yet filled in any details.
So far webmull has created 65 blog entries.
29 07, 2015

Magento 2: Upload the image from admin side

July 29th, 2015|MAGENTO, MAGENTO 2|0 Comments

Here is code for upload the image from admin side in magento 2:

use Magento\Framework\App\Filesystem\DirectoryList;

public function __construct(

\Magento\MediaStorage\Model\File\UploaderFactory $fileUploaderFactory,

) {

$this->_fileUploaderFactory = $fileUploaderFactory;

}

public function uploadImage(){

$uploader = $this->_fileUploaderFactory->create(['fileId' => 'image']);

$uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);

$uploader->setAllowRenameFiles(false);

$uploader->setFilesDispersion(true);

$path = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA)

->getAbsolutePath('{moduleName}/');

$result = $uploader->save($path);

}

 

29 07, 2015

Magento 2: Create the Contact us page by CMS

July 29th, 2015|MAGENTO, MAGENTO 2|0 Comments

Here, we need to create the different contact us page. We want the different url for contact us page. So for this we will create the new cms page.

In the cms page content we write the following code to display the cms page form

{{block [...]

29 07, 2015

Magento 2: Create Featured Product Module

July 29th, 2015|MAGENTO, MAGENTO 2|5 Comments

We are very exciting after we have successfully created featured product module and We want to share with you.
Let’s create the featured product module. We will need
app/code/Webmull/Featuredproduct/Block

app/code/Webmull/Featuredproduct/etc

app/code/Webmull/Featuredproduct/Setup

app/code/Webmull/Featuredproduct/view/frontend/templates

Now, We have created directory structure for the module. Now we will create the file for this.

1. First we create the configuration file module.xml in app/code/Webmull/Featuredproduct/etc

The […]

29 07, 2015

Magento 2: get the Current Url

July 29th, 2015|MAGENTO, MAGENTO 2|0 Comments

We can use below syntax to get current Url:

protected $_urlinterface;


public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Framework\UrlInterface $urlinterface,
array $data = []
) {
parent::__construct($context, $data);
$this->_urlinterface = $urlinterface;
}


public function getCurrentUrl()
{
return $this->_urlinterface->getCurrentUrl(); // Give the current url of recently viewed page
}

 

29 07, 2015

Magento 2: getBase url

July 29th, 2015|MAGENTO, MAGENTO 2|0 Comments

Here is code for get Base URL in magento 2:

public function getBaseUrl()
{
return $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
}

 

29 07, 2015

Magento 2: Get the Current Store

July 29th, 2015|MAGENTO, MAGENTO 2|0 Comments

Here is code for get current store in magento 2:

 protected $_storeManager;


public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = []
) {
parent::__construct($context, $data);
$this->_storeManager = $storeManager;
}


public function getCurrentStore(){
return $this->_storeManager->getStore(); // give the information about current store
}

 

29 07, 2015

Magento 2: Create New Custom theme

July 29th, 2015|MAGENTO, MAGENTO 2|0 Comments

In magento 2, all the file structure is changed compare to older version. So let’s start to create new theme in magento 2

Create Theme Directory

  1. Go to the magento Directory
  2. Create the directory <vendor> in the path app/design/frontend. <Vender> Should be the interface or package name for theme.
  3. Create the theme folder on […]
27 07, 2015

WordPress: Common Error : themes are installed but incomplete, Themes must have a stylesheet and a template

July 27th, 2015|COMMON ERROR, WORDPRESS|0 Comments

“Broken Themes”

” themes are installed but incomplete. Themes must have a stylesheet and a template “

Above Error message, display on Appearance -> Themes -> list of theme, when we have problem in new created theme or new created wordpress child theme.

In generally wordpress theme have below minimom file for wordpress […]

27 07, 2015

WordPress broken or crash after install plugin or theme

July 27th, 2015|WORDPRESS|0 Comments

WordPress Broken Plugin or Theme:

Most of web developer or WordPress administrator face problem to suddenly crash/broken their website on server or localsystem and specially it has happen after install any new plugin or theme.

Actually There could be chance that when you install any plugin or theme which is not properly […]

27 07, 2015

WordPress: WordPress Content Type POST VS PAGES

July 27th, 2015|WORDPRESS|0 Comments

WordPress have two type of content Post and Pages, which display different kind of content.

WordPress Post content type:

  • Posts generally display dynamic content and it kind of content which should continuously updated, for example., news, blog and articles etc.
  • Posts are organize base on publish date and time, category, tags or author.

WordPress […]