getWebsites(false); foreach ($websites as $website) { /* @var $website Mage_Core_Model_Website */ $store = $website->getDefaultStore(); if (!$store) { continue; } // customer attributes $attributes = array( 'prefix', 'middlename', 'suffix', 'dob', 'taxvat', 'gender' ); foreach ($attributes as $attributeCode) { $attribute = $eavConfig->getAttribute('customer', $attributeCode); $configValue = $addressHelper->getConfig($attributeCode . '_show', $store); $isVisible = $attribute->getData('is_visible'); $isRequired = $attribute->getData('is_required'); if ($configValue == 'opt' || $configValue == '1') { $scopeIsVisible = '1'; $scopeIsRequired = '0'; } else if ($configValue == 'req') { $scopeIsVisible = '1'; $scopeIsRequired = '1'; } else { $scopeIsVisible = '0'; $scopeIsRequired = '0'; } if ($isVisible != $scopeIsVisible || $isRequired != $scopeIsRequired) { $attribute->setWebsite($website); $attribute->setScopeIsVisible($scopeIsVisible); $attribute->setScopeIsRequired($scopeIsRequired); $attribute->save(); } } // customer address attributes $attributes = array( 'prefix', 'middlename', 'suffix', ); foreach ($attributes as $attributeCode) { $attribute = $eavConfig->getAttribute('customer_address', $attributeCode); $configValue = $addressHelper->getConfig($attributeCode . '_show', $store); $isVisible = $attribute->getData('is_visible'); $isRequired = $attribute->getData('is_required'); if ($configValue == 'opt' || $configValue == '1') { $scopeIsVisible = '1'; $scopeIsRequired = '0'; } else if ($configValue == 'req') { $scopeIsVisible = '1'; $scopeIsRequired = '1'; } else { $scopeIsVisible = '0'; $scopeIsRequired = '0'; } if ($isVisible != $scopeIsVisible || $isRequired != $scopeIsRequired) { $attribute->setWebsite($website); $attribute->setScopeIsVisible($scopeIsVisible); $attribute->setScopeIsRequired($scopeIsRequired); $attribute->save(); } } $attribute = $eavConfig->getAttribute('customer_address', 'street'); $value = $addressHelper->getConfig('street_lines', $store); if ($attribute->getData('multiline_count') != $value) { $attribute->setWebsite($website); $attribute->setScopeMultilineCount($value); $attribute->save(); } }