Fix Magento 1.9.2 Notice: Undefined variable: block in …/Template/Filter.php line 187

Recently we have this bug ” Notice: Undefined variable: block in …/Template/Filter.php line 187 ” on a project after updating SUPEE-6788 in Magento 1.9.2.x . After installation of the patch some parts of the front-end home page template stayed blank. Review of the exception.log file shows a number of exceptions that occur from…

Magento – TinyMCE Image Uploader – Image incorrect URL

Recently, I have worked on a project which has this strange bug, the image url in Wysiwyg is not correctly. Only administrator can see this image while guess users can not see it. For example : the image url which is generated by Wysiwyg : <img src=”http://www.mysite.com//index.php/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvcmd0LXNsaWRlci1pbWcwMS5qcGcifX0/key/ceed8184f5f336aafcc307f8623aff45/” /> In that case, the…

Get addtional attributes product Magento

Follow the below codes to get addtional attributes product Magento $tmpProd = Mage::getModel(‘catalog/product’)->load($product->getId()); $attributes = $tmpProd->getAttributes(); $addtionalAttributes = array(); foreach ($attributes as $attribute) { if ($attribute->getIsVisibleOnFront()) { $addtionalAttributes[“{$attribute->getStoreLabel()}”] = $attribute->getFrontend()->getValue($tmpProd); } }

Get all configured rates of the tablerate shipping module

Get all configured rates of the tablerate shipping module : $tablerateColl = Mage::getResourceModel(‘shipping/carrier_tablerate_collection’); /* @var $tablerateColl Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection */ foreach ($tablerateColl as $tablerate) { /* @var $tablerate Mage_Shipping_Model_Carrier_Tablerate */ Zend_Debug::dump($tablerate->debug()); }  

Update stock item quantity for a product in magento

Here is the useful code for a purpose : update stock item quantity for a product in magento: $product = Mage::getModel(‘catalog/product’)->load($productId); if ($product){ if (!($stockItem = $product->getStockItem())) { $stockItem = Mage::getModel(‘cataloginventory/stock_item’); $stockItem->assignProduct($product); } $stockItem->setData(‘qty’,intval($qty)) ->setData(‘is_in_stock’, intval($qty) > 0 ? 1 : 0) ->setData(‘manage_stock’, 1) ->setData(‘use_config_manage_stock’, 0) ->save(); }    

Please Add Widget