Get attribute value for PLAIN TEXT, TEXTAREA or DATE type attribute:
<?php if ($_product->getWhatsincluded()): ?>// what is included is custom textarea attribute. <?php echo $_helper->productAttribute($_product, $_product->getwhatsincluded(), 'whatsincluded') ?> <?php endif;?>
Get value from SELECT, MULTISELECT, DROPDOWN or YES/NO attributes:
$attribute_value = $product->getAttributeText($attribute_code);
Or $attribute_value = $product->getResource()->getAttribute($attribute_code)->getFrontend()->getValue($product);
Get value from PRICE attributes:
$attribute_value = $product->getNew_price(); //for attribute code "new_price"
and in product list page,
$attribute_value = $product->getNewPrice();
Get attribute value by attribute code and productID WITHOUT loading whole product
$attribute_value = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id, $attribute_code, $store_id);
0 Comments