I am trying to retrieve all options for all store views for a single attribute e.g. color
.
For the attribute color
I have created two options blue
and white
. I have tried the following code that is suppose to return all the options labels for all store views, but only returns the admin
option label for me.
$option_arr = array();
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'color');
foreach ($attribute->getSource()->getAllOptions(false) as $option) {
$option_arr[$option['value']] = $option['label'];
}
// $option_arr contains Array([4] => Blue, [3] => White)
The following works fine for getting all the attribute color
titles for each store view, but does not work for options.
$product = Mage::getModel('catalog/product')->load();
$attribute_title = $product->getResource()->getAttribute('color');
// $attribute_title contains Array([1] => ~~~, [2] =>Color, [3] => Couleur, [4] => Còôlòôr)
Best Answer