Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Adding custom Attribut to Product/view.phtml
 
Lezepal
Jr. Member
 
Total Posts:  4
Joined:  2009-07-19
 

Hi all,
I have spend many time to search a solution to this prob. On google also on Mage Forum. But i haven’t found any kinds of solutions.
So let see the matter:

On my website i have hack about 4 month the Product/View.phtml to display a custom Attribut Text. I remember that i have to create a new file on app/code/..../Mage/Catalog/Block/Product/View like this

class Mage_Catalog_Block_Product_View_Opinion extends Mage_Core_Block_Template
{
    
protected $_product null;

    function 
getProduct()
    
{
        
if (!$this->_product{
            $this
->_product Mage::registry('product');
        
}
        
return $this->_product;
    
}
}

And after i just call it like other attribut on my view.phtml by

<?php echo $_product->getopinion ?>

But now, when i try to remake this code to work on my new template it didn’t work

I think, i forget an etape. I do not remember what i have hack else.

The attribut is set to be desplay on “product-collateral”

So please help me, what i have to do to display my custom attribut to My product View. Also if it’s possible i need a solution that is completly clear for futur update.
Thanks for reply

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lezepal
Jr. Member
 
Total Posts:  4
Joined:  2009-07-19
 

Strangely, the code run now, so don’t care about this post.
I hope this one can help someone else.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top