$attribute_code = 'some_attribute_code';
    $attribute = Mage::getModel('eav/config')->getAttribute('customer_address',$attribute_code);
    $options = $attribute->getSource()->getAllOptions();
    foreach ($options as $option) {
        if ($option['label'] === '' && $option['value']) {
            $newOptions['value'][$option['value']][]  = $option['label'];
            $newOptions['delete'][$option['value']]   = $option['value'];
        }
    }
    $installer->addAttributeOption($newOptions);
    $collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
        ->setAttributeFilter($attribute->getId())
        ->setStoreFilter($attribute->getStoreId())
        ->load();
    foreach ($collection as $option) {
        $option->delete();
    }
  
    $installer->removeAttribute('customer_address', $attribute_code);

Info about this type of attribute, may be stored also in ‘customer_form_attribute’ table.

Leave a reply

Your email address will not be published.