首页 > 代码库 > magento 获取attribute的所有option

magento 获取attribute的所有option

$attribute = Mage::getSingleton(‘eav/config‘)->getAttribute(‘catalog_product‘, ‘color‘);
if ($attribute->usesSource()) {
   $options = $attribute->getSource()->getAllOptions(false);
}