0

How to add a new drop down beside "Price Type" present in custom options of Product Information.

See Image for detail

0

So here how i did it .. may be it can help someone too.

Step 1

open

/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml

First we need to create a html select option

As i needed to show the shipping options , i have created the select option using my own So open the file and add the code at the top.

$shipping = array( array( 'value' => 'UPS', 'label' => 'UPS', ), array( 'value' => 'DHL', 'label' => 'DHL', ), array( 'value' => 'Spedition', 'label' => 'Spedition' ), array( 'value' => 'Hermes', 'label' => 'Hermes' ), ); $select = $this->getLayout()->createBlock('core/html_select'); $select->setOptions($shipping); $select->setName('product[options][{{id}}][values][{{select_id}}][title]') ->setClass('required-entry input-text select-type-title {{title}}') ->setId('product_option_{{id}}select{{select_id}}_title')

here as i don't need the title option i replaced that field name with my new select option .

Then for the variable OptionTemplateSelectRow add the select option

   +'<?php echo $select->getHtml();?>{{checkboxScopeTitle}}</td>'+

After you can be able to see the select option in place of title.

Now for the selectOptionType script variable in the "add" name option add the below code after if (data.price_type) { }

Add the below code:

if (data.title) {
             $A($('product_option_'+data.id+'_select_'+data.select_id+'_title').options).each(function(option){
            if (option.value==data.title) option.selected = true;
        });
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.