MAGENTO 1.7.0.2获取属性的管理员值的集合

时间:2013-05-24 10:03:41

标签: magento

我需要获取属性(颜色)的admin值的集合。 我使用了这个函数,但它返回默认的商店视图值。

function getAttributes($option) {
//DEFINE MODEL
$catalog_products = Mage::getModel("catalog/product");

$attributes = Mage::getResourceModel("eav/entity_attribute_collection")
->setEntityTypeFilter($catalog_products->getResource()->getTypeId())
->addFieldToFilter("attribute_code", $option);

$attribute = $attributes->getFirstItem()->setEntity($catalog_products->getResource());

        foreach($attribute->getSource()->getAllOptions(false) as $current)
            $collection[$current["value"]] = strtolower($current["label"]);

return $collection; }

因此,例如,在这个值序列中 http://aruba.uriosweb.com/admin-values.png

它返回:

[32] => ACCIAIO
[388] =>前
[33] => algodo

但我愿意:

[32] =>银
[388] =>前
[33] => algodo

0 个答案:

没有答案