getAttribute('customer_address', $attributeCode); $usedInForms = $attribute->getUsedInForms(); if (!in_array('customer_register_address', $usedInForms)) { $usedInForms[] = 'customer_register_address'; $attribute->setData('used_in_forms', $usedInForms); $attribute->save(); } }