I'm trying to display an additional product attribute when managing a product's attributes.

I've set up the attribute as follows:


the descriptions (addable and editable by admin users in the config section) need to be displayed as a multi select dropdown.

I've written the following to programmatically add the attribute for products:

/* @var $this Mage_Core_Model_Resource_Setup */
$installer = $this;

$installer->addAttribute('catalog_product', 'additional_product_description', array(
    'group'                => 'General',
    'type'              => 'text',
    'backend'           => 'adminhtml/system_config_backend_serialized_array', // ***** NOT SURE IF THIS IS CORRECT, PLEASE ADVISE *****
    'frontend_input'    => '',
    'frontend'          => '',
    'label'             => 'Additional Product Descriptions',
    'input'             => 'multiselect',
    'class'             => '',
    'source'            => '***** ***** ***** NEED HELP HERE ***** ***** *****',
    'global'             => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,//can be SCOPE_WEBSITE or SCOPE_STORE
    'visible'           => true,
    'used_in_product_listing' =>true, //can also be false
    'frontend_class'     => '',
    'required'          => false,//can be true
    'user_defined'      => true,
    'default'           => '',
    'searchable'        => false,//can be true
    'filterable'        => false,//can be true
    'comparable'        => false,//can be true
    'visible_on_front'  => false,//can be true
    'unique'            => false,
    'position'            => 60,//put any number here


I can't figure out what I am supposed to use as the source - could anyone please advise?

The system.xml that sets up the serialized array I want to use for the attribute is the following:

    <descriptions translate="label">
        <label>Product Descriptions</label>

I have already tested, and the config section works without any issues, I now need to add an attribute field to the products' attributes.

Any help would be massively appreciated.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.