In one of the modules we are developing we require to create a multi-select attribute with several options. It's highly important that these options are given a certain order by default.
This is the current code for adding the attribute:
$installer->addAttribute('catalog_product', 'tariffplan_sms_slider', array(
'attribute_set' => 'Randomattributeset',
'group' => 'Sample',
'type' => 'varchar',
'default' => 0,
'required' => false,
'visible' => true,
'backend' => 'eav/entity_attribute_backend_array',
'frontend' => '',
'label' => 'Random label',
'note' => '',
'input' => 'multiselect',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
'option' => array ('value' =>
array(
'one' => array("Low"),
'two' => array("Medium"),
'three' => array('High'),
'four' => array('Unlimited')
)
),
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => 0,
'visible_on_front' => false,
'used_in_product_listing' => false,
'unique' => false
));
As you can see I'm giving an array of options for this attribute that will be created. On top of that I would like to set the order (see Position input fields in the backend) of each option.
I have tried the following below but it isn't working:
'option' => array (
'value' => array(
'one' => array("Don't care"),
'two' => array("Low"),
'three' => array('High'),
'four' => array('Unlimited')
),
'order' => array(
'one' => 0,
'two' => 1,
'three' => 2,
'four' => 3
)
),
Version: Magento ver. 1.7.0.1
Anyone got an idea?