Friday, January 27, 2012

Useful Magento Snippets For Your Next Project


useful magento snippets for your next project

Creating and calling custom attribute if textbox or textarea
getAttributeName() ?>
if dropdown
  getAttributeText('shirt_size') ?>

Calling Page Title Anywhere in the PHTML

getBlock('head')->getTitle(); ?>

Display Category Product in Product View

getProduct()->getCategory() ? $this->getProduct()->getCategory()->getName() : 'no category') ?>

Display Short Description

load($_item->getProductId()); echo $custom->getShortDescription(); ?>

Display Grandtotal

formatPrice(Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal()); ?>


Post a Comment

Speak my Friend

Design by ThemeShift | Bloggerized by Lasantha - Free Blogger Templates | Best Web Hosting