Skip to main content
added 113 characters in body
Source Link

In installer These are the two line after addAttribute which ben explain to add default:

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
. . . . 
. . . . 
. . . .     
$attr = $setup->getAttribute('catalog_product', 'attribute_code');
$setup->updateAttribute('catalog_product',$attr['attribute_id'],'default_value', 'default_value1,default_value2,default_value3,default_value4');

attribute_code: will be your attribute code default_value1: will be your corresponding value separate by ,

These are the two line after addAttribute which ben explain to add default:

$attr = $setup->getAttribute('catalog_product', 'attribute_code');
$setup->updateAttribute('catalog_product',$attr['attribute_id'],'default_value', 'default_value1,default_value2,default_value3,default_value4');

In installer These are the two line after addAttribute which ben explain to add default:

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
. . . . 
. . . . 
. . . .     
$attr = $setup->getAttribute('catalog_product', 'attribute_code');
$setup->updateAttribute('catalog_product',$attr['attribute_id'],'default_value', 'default_value1,default_value2,default_value3,default_value4');

attribute_code: will be your attribute code default_value1: will be your corresponding value separate by ,

Source Link

These are the two line after addAttribute which ben explain to add default:

$attr = $setup->getAttribute('catalog_product', 'attribute_code');
$setup->updateAttribute('catalog_product',$attr['attribute_id'],'default_value', 'default_value1,default_value2,default_value3,default_value4');