0

I have a custom attribute in Magento for a grouped product minimum priced RRP. I want to be able to pull this through into the product grid within my theme, however, i cannot find whether this is possible or not. The attribute is simply called 'rrp'.

Originally i had this:

$_item = $this->getItem();
$_product= Mage::getSingleton('catalog/product')->load($_item->getProductId());
$rrp = $_product->getResource()->getAttribute('rrp')->getFrontend()->getValue($_product);

But if i go

<?php echo $rrp; ?>

it simply does not work.

Am i missing something?

Full code here for my 'featured grid' - http://pastebin.com/mn8BYvwA

Dom Greenslade BSc
  • 369
  • 1
  • 3
  • 13
  • Not sure whether using `Mage::getSingleton()` here would be an issue, you might try `Mage::getModel('catalog/product')->load($productId)->getAttributeText('rrp')` to make sure your product has the attribute set. [Relevant earlier question](http://stackoverflow.com/q/6924226/1737136). – fantasticrice Mar 20 '15 at 15:50

1 Answers1

0
        // Use entity id to load a product.
        $oProductModel = Mage::getModel( 'catalog/product' )->load( 1 );
        $sRrp= $oProductModel->getData( 'rrp' );
        var_dump( $sRrp );
        $sFormat  = $oProductModel->getAttributeText( 'rrp' );
        var_dump( $sFormat );
Vladimir Ramik
  • 1,920
  • 2
  • 13
  • 23