简体   繁体   English

将自定义产品属性显示到Magento中的产品网格上

[英]Display custom product attribute onto product grid in Magento

I have a custom attribute in Magento for a grouped product minimum priced RRP. 我在Magento中有一个自定义属性,用于分组产品的最低价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'. 该属性简称为“ 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 我的“功能网格”的完整代码-http://pastebin.com/mn8BYvwA

        // 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 );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM