Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $updateAttributeOptionValue = function() {
- $attribute_model = Mage::getModel('eav/entity_attribute');
- $attribute_id = $attribute_model->getIdByCode('catalog_product', 'color');
- $attribute = $attribute_model->load($attribute_id);
- $arrColor = array(
- 'Brown',
- 'Charcoal',
- 'Green',
- 'Grey',
- 'Idigo',
- 'Ivory',
- 'Khaki',
- 'Oatmeal',
- 'Orange',
- 'Pink',
- 'Purple',
- 'Royal Blue',
- 'Silver',
- 'Taupe',
- 'White',
- 'Yellow'
- );
- $value['option'] = $arrColor;
- $result = array('value' => $value);
- $attribute->setData('option',$result);
- try {
- $attribute->save();
- }
- catch(Exception $e) {
- echo $e->getMessage();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement