Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. $updateAttributeOptionValue = function() {
  2.  
  3. $attribute_model = Mage::getModel('eav/entity_attribute');
  4. $attribute_id = $attribute_model->getIdByCode('catalog_product', 'color');
  5. $attribute = $attribute_model->load($attribute_id);
  6.  
  7. $arrColor = array(
  8. 'Brown',
  9. 'Charcoal',
  10. 'Green',
  11. 'Grey',
  12. 'Idigo',
  13. 'Ivory',
  14. 'Khaki',
  15. 'Oatmeal',
  16. 'Orange',
  17. 'Pink',
  18. 'Purple',
  19. 'Royal Blue',
  20.  
  21. 'Silver',
  22. 'Taupe',
  23. 'White',
  24. 'Yellow'
  25. );
  26.  
  27. $value['option'] = $arrColor;
  28. $result = array('value' => $value);
  29. $attribute->setData('option',$result);
  30.  
  31. try {
  32. $attribute->save();
  33. }
  34. catch(Exception $e) {
  35. echo $e->getMessage();
  36. }
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement