All Articles

Displaying Custom Attributes on the Product Page in Magento

At some point you may not want to use the canned attributes.phtml groupings that magento provides, or you just want to cherry pick which attributes to show on your product listing page template/catalog/product/view.phtml

$_product = $this->getProduct();

//For the attribute bike_specs_rear_shock

$_product->getResource()->getAttribute('bike_specs_rear_shock')->getStoreLabel(); //label
$_product->getbike_specs_rear_shock(); //value
Published 29 Jun 2010

Code. Comics. Crossfit
Tim Broder on Twitter