[英]Display custom product attribute onto product grid in Magento
我在Magento中有一個自定義屬性,用於分組產品的最低價RRP。 我希望能夠將其引入主題范圍內的產品網格中,但是,我無法確定是否可行。 該屬性簡稱為“ rrp”。
本來我有這個:
$_item = $this->getItem();
$_product= Mage::getSingleton('catalog/product')->load($_item->getProductId());
$rrp = $_product->getResource()->getAttribute('rrp')->getFrontend()->getValue($_product);
但是如果我去
<?php echo $rrp; ?>
它根本不起作用。
我想念什么嗎?
我的“功能網格”的完整代碼-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.