2017-10-08 119 views
0

我已在magento 1.9上创建了一个新属性,并称为category_grouped。现在我试图通过使用getAttributeRawValue来获得它在目录页面上的值,但我所得到的只是一个ID。我怎么能得到价值的名称,而不是ID?以下是我的代码。由于获取属性值 - Magento

<?php $attributeId = Mage::getResourceModel('catalog/product')- 
>getAttributeRawValue($_product->getID(), 'category_grouped', $storeId);?> 

回答

-1

您可以通过下面的代码

$product->CategoryGrouped(); 

感谢

0

的getAttributeText获取给定属性的值/名称设置属性值,而在这种情况下,ID getAttributeText回报。

$attributeValue = Mage::getModel('catalog/product') 
    ->load($_product->getID()) 
    ->getAttributeText('category_grouped');