General functions Function Description $this->getRequest()->getServer(‘HTTP_REFERER’); Get the referer URL Product related functions Function Description $product->getName() Get product name $product->getSku() Get product sku Mage::getModel(‘cataloginventory/stock_item’)->loadByProduct($_product)->getQty() Get product stock $product->getResource()->getAttribute(‘color’)->getFrontend()->getValue($product) Get a product attribute value (like color/size) $product->isSaleable() checks if a product is salable $product->isisAvailable() checks if a product type is salable Mage::getModel(‘catalogrule/rule’)->calcProductPriceRule($product,$product->getPrice()) Gets the product final price Full Article…
Redirecting to the last page after customer login magento
On a current project, I had a requirement to redirect to the homepage once a user successfully logs in to their account. I tried a few plugins to no avail, so had a go doing it myself. Obviously Magento by default, redirects to the customers Account page although there is a setting in the admin Full Article…
ADDING CUSTOM PRODUCT ATTRIBUTE TO QUOTE AND ORDER ITEMS IN MAGENTO
If you are developer, adding custom product attribute to quote and order items in Magento is pretty common task. And if you face with the same issue we will be very glad when you find this article helpful. Start with creating new module. In config.xml we need to define resources section which allows us to Full Article…
Magento Category Collection Grid/List View
Now let start with explanation and steps. Please go through the previous blog on paging to understand this better. Step1: IndexController In the indexcontroller of your module we will write very simple code, to just load and render the layout. 1 2 3 4 5 6 7 8 9 <?php class Excellence_Collection_IndexController extends Mage_Core_Controller_Front_Action { public function Full Article…