1

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

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

4

0 回答 0