2017-10-08 87 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');