Hi Guys,
I have this script to insert attribute values in the database. When I run it, only the first value of the array is inserted. Could someone help me?
<?php
require_once('./app/Mage.php');
Mage::app();
$arg_attribute = 'manufacturer';
$manufacturers = array('NW163UA G70-467','NW167UA G70-481','VM113UA G71-333','VR759UA G71-340','VM114UA G71-343','VM110UA G71-347','VM116UA G71-349','VR761UA G71-358','VR760UA G71-400');
$attr_model = Mage::getModel('catalog/resource_eav_attribute');
$attr = $attr_model->loadByCode('catalog_product', $arg_attribute);
$attr_id = $attr->getAttributeId();
$option['attribute_id'] = $attr_id;
foreach ($manufacturers as $key=>$manufacturer) {
$option['value'][$key.'_'.$manufacturer][0] = $manufacturer;
}
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttributeOption($option);
?>