Category Archives: Magento

Product description on product listing page

<?php
 echo $_product->getShortDescription();  // for printing short description
 echo $_product->getDescription(); // for printing  description
 //For displaying description, Go to the admin pannel 
 //Catalod->Attributes-> Manage Attributes and edit the description attribute.
 //Set "Used in product listing" to "Yes".
?>

How to get site URL – Magento

You can use the following function to get site urls .

Below given are the function with different arguments

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) – http://magesite.extension/js/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) – http://magesite.extension/index.php/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) – http://magesite.extension/media/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) – http://magesite.extension/skin/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)  -http://magesite.extension/

$currentUrl = $this->helper('core/url')->getCurrentUrl(); // Displays URL of the current page