Thursday 30 October 2014

Get custom attribute value in Magento


Get custom attribute value in Magento

<?php
    $attribute = $_product->getResource()->getAttribute('attribute_code');
    if ($attribute)
    {
        echo $attribute_value = $attribute->getFrontend()->getValue($_product);
    }
?>

1 comment:

Anonymous said...

Hi,

Can you please tell me how can i take custom input value and assign that value as product price in add to cart page?

i have one product which is custom order, a user can input any number and that number should become as product value.

So request you to please hlep me.