views:

30

answers:

1

Hi guys,

How do I have to add the Manufacturers Attribute in Magento using php?

Thanks

A: 
private function addManufacturers($manufacturer){

        //add new manufacturer
        $option['attribute_id'] = 70; //manufacturer
        $option['value']['any_key_that_resolves_to_zero'][0] = $manufacturer;

        $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
        $setup->addAttributeOption($option);
        return $this->getManufacturerId($manufacturer);

}
Michelangelo