Monday, June 27, 2016

Magento 2 get new products collection on homepage

(1) Create A Block File in app/code/Companyname/NewProduct/Block/NewProduct.php <?php namespace Companyname\NewProduct\Block; use Magento\Catalog\Api\CategoryRepositoryInterface; use Magento\Catalog\Model\Category; use Magento\Catalog\Block\Product\AbstractProduct; use Magento\Catalog\Model\Product; use...

Saturday, June 18, 2016

Magento 2 Getting product Image url

$imagehelper = $objectManager->create('Magento\Catalog\Helper\Image'); $image = $imagehelper->init($_product,'category_page_list')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(400)->getUrl(); <img src="<?php echo $image; ?>">...

Change inventory on select configurable options

=> Please follow the below steps for the inventory options changes. Step 1 :   \app\design\frontend\rwd\default\template\catalog\product\view\type\options\configurable.phtml file in replace below code <?php $_product    = $this->getProduct(); $_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes()); $_jsonConfig...