long time no post, this is useful script to get option list of product attribute
$attribute = Mage::getSingleton(‘eav/config’)->getAttribute(‘catalog_product’, ‘brand’);
if ($attribute->usesSource()) {
$options = $attribute->getSource()->getAllOptions(false);
foreach($options as $option) {$data_array[$option[‘value’]]=$option[‘label’];
}
}
print_r($data_array)
/* result
Array
(
[value] => 81
[label] => Alergon
)
Array
(
[value] => 80
[label] => Hilo
)
Array
(
[value] => 79
[label] => L-Men
)
Array
(
[value] => 78
[label] => NutrIsari
)
Array
(
[value] => 77
[label] => Tropicana Slim
)
Array
(
[value] => 76
[label] => W’dank
)
Array
(
[value] => 75
[label] => WRP
)*/
Be First to Comment