$arg_attribute = '<attribute-code>';
$attr_model = Mage::getModel('catalog/resource_eav_attribute');
$attr = $attr_model->loadByCode('catalog_product', $arg_attribute);
$attr_id = $attr->getAttributeId();
$opt['attribute_id'] = $attr_id;
$opt['value']['<admin-value>'][0] = '<admin-name>'; //admin name of option
$opt['value']['<admin-value>']][1] = '<admin-name>'; //default store name of option
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttributeOption($opt);
Please specify what you mean for ['admin-value']
ReplyDeleteThank you
Giuseppe
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. Magento 2 Freelancers
ReplyDelete