Cart Counter:
helper('checkout/cart')->getSummaryCount(); //get total items in cart $total = $this->helper('checkout/cart')->getQuote()->getGrandTotal(); //get total price if ($count == 0) { echo $this->__('(0 ITEMS)', $count); } if ($count == 1) { echo $this->__('(1 ITEM)', $count); } if ($count > 1) { echo $this->__('(%s ITMES)', $count); } ?>
Create Block By XML:
Create block by PHP:
getLayout()->createBlock('core/template')->setTemplate('page/html/feature-ads.phtml')->toHtml(); ?>
Layout local.xml
skin_css css/styles.css skin_js js/functions.js skin_js scripts/functions.js skin_css css/styles.css js scripts/functions.js header_cms_block pronav/navigation_top.phtml page/3columns.phtml customer-account-page
Check if customer login or not:
if ( $this->helper('customer')->isLoggedIn() ) { //loggedin }
Debug layout:
var_dump(Mage::app()->getLayout()->getUpdate()->getHandles());
Get Product Attribute from id, without loading product
Mage::getResourceSingleton('catalog/product') ->getAttributeRawValue($productId, 'url_key', Mage::app()->getStore());