Magento Functions

Posted: May 16, 2013 in Magento

To Call cms static block in phtml file :
<?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘footer_links’)->toHtml() ?>

To Call Image Path :
{{skin url=’images/media/about_us_img.jpg’}}

To get Image,Javascript or css path from yout skin folder :
getSkinUrl(“folder/filename”)?>

To call child block in phtml file :
getChildHtml(‘topLinks’) ?>

Get Sku :
<?php echo $_product->getSku() ?>

Add Home Page New Product :
{{block type=”catalog/product_new” name=”home.catalog.product.new” alias=”product_homepage” products_count=”16″ template=”catalog/product/new.phtml”}}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s