/** * Update the frontend labels of the attribute * * @param Mage_Catalog_Model_Entity_Attribute $attribute Attribute to update * @param Aoe_AttributeConfigurator_Model_Config_Attribute $attributeConfig Attribute config * * @return void */ protected function _updateAttributeLabels($attribute, $attributeConfig) { $stores = Mage::app()->getStores(true); $storeLabels = []; $frontendLabel = $attribute->getAttributeCode(); foreach ($stores as $store) { /** @var Mage_Core_Model_Store $store */ $storeLocale = Mage::getStoreConfig('general/locale/code', $store); $storeLabel = $attributeConfig->getLabel($storeLocale); if (!$storeLabel) { continue; } $storeLabels[$store->getId()] = $storeLabel; if (0 == $store->getId()) { $frontendLabel = $storeLabel; } } $attribute->setFrontendLabel($frontendLabel)->setStoreLabels($storeLabels); $attribute->save(); }