magento产品取某个产品下拉属性的全部列表值
比如取长度length的全部列表值:
[php] view plaincopy
$length_attribute_id = Mage::getResourceModel(‘eav/entity_attribute’)->getIdByCode(‘catalog_product’,'length’);
$length_attribute = Mage::getModel(‘eav/config’)->getAttribute(‘catalog_product’, $length_attribute_id);
$length_set = array();
foreach ( $length_attribute->getSource()->getAllOptions(true, true) as $option){
$length_set[$option['value']] = $option['label'];
}
参考:http://www.sharpdotinc.com/mdost/2009/04/06/magento-getting-product-attributes-values-and-labels/