Hello,
I need to delete certain option value from an attribute, for example color
. If color
has red, blue and green as options, then I need to delete one of them, for example blue.
I have so far been able to get the attribute values but I am having problems deleting a particular option.
$attribute_model = Mage::getModel('eav/entity_attribute');
$attribute_options_model= Mage::getModel('eav/entity_attribute_source_table') ;
$attribute_code = $attribute_model->getIdByCode('catalog_product', 'color_pattern');
$attribute = $attribute_model->load($attribute_code);
$attribute_table = $attribute_options_model->setAttribute($attribute);
$options = $attribute_options_model->getAllOptions(false);
How can I delete an option from the list of options? Any help will be appreciated.
Thanking you,