valentina.a87
valentina.a87

Reputation: 127

magento custom attribute label disappears

I've created a new phtml page to put inside the view page of the product, in this phtml page I called a new custom attribute that I have associated at the product, whit this code (I've the suggestion in this website, and this was working wonderfully!):

        <?php $product_id = Mage::registry('current_product')->getId();
        $_product=Mage::getModel('catalog/product')->load($product_id);
        echo $_product->getAttributeText('video'); ?>

but now I have made the new magento update and my custom attribute is disappeared, this is strange because I don't work in the base file of Magento but I've created a my theme to work. It's possible that something is changed in Magento?

Thank you for the help!

Upvotes: 0

Views: 332

Answers (1)

Michel Arteta
Michel Arteta

Reputation: 1384

Try this way:

$_helper = $this->helper('catalog/output'); 
$_product = $this->getProduct(); 

//Display custom attribute. 
//Attribute code = video;

$product = Mage::getModel('catalog/product')->load($_product->getId());
$attribute = $product->getResource()
         ->getAttribute('video')
         ->getFrontend()->getValue($product);

echo $attribute;

From My blog

Upvotes: 0

Related Questions