<?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". ?>
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". ?>
Include a block in sidebar – Magento
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" template="catalog/navigation/left_nav.phtml" />
</reference>
Please create file with the given name "left_nav.phtml " and put it in the corresponding location
eg : /app/design/frontend/your_package/yourtheme/template/catalog/navigation/left_nav.phtml
List Products under a given category
{{block type=”catalog/product_list” category_id=”12″ template=”catalog/product/list.phtml”}}
It will list all the products under the category id “12” .
Site URL in CMS static block / Pages – Magento
{{store url=’mypage.html’}} will return the full sitr ur l . ie http://sitename.com/mypage.html/
and
{{store direct_url=’mypage.html’}} will return the full sitr ur l . ie http://sitename.com/mypage.html
Include a phtml page in CMS block – Magento
The below given code will display the the content added in “newPage.phtml”
{{block type=”core/template” name=”list-categories” template=”catalog/category/newPage.phtml”}}
Include a CMS Block in phtml file – Block
<?php
//The following code will load the block with the given "identifier"
// on the phtml page
echo $this->getLayout()->createBlock('cms/block')->
setBlockId('identifier')->toHtml()
?>
How to give Image path in cms page /blocks
To give image path you can use {{skin url=’yourimage.gif’}} .
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
How to include custom JavaScript from skins folder – Magento
Please include the following line in page.xml page to include js file from the your theme folder
<action method=”addItem”><type>skin_js</type><script>filename.js</script></action>
The path will be www.yourSiteName.com/skin/frontend/mind/extreme/js/filename.js