Magento – Mass update of custom options

[stextbox id=”alert”]We have released the custom option template module by which adding custom option in all products is super easy magento custom option template[/stextbox]

 

 

Replicate Magento Custom Option : This must be a default feature in magento but somehow it is not exist by default  , we got a lot of request for this problem . We can replicate mass product custom options by custom option template .Here is a sample code by which you can mass replicate your magento custom options

Step 1: change the app/design/adminhtml/default/default/template/page/head.phtml with the attached head.phtml

Step 2: app/design/adminhtml/default/default/template/catalog/product/edit/options.phtml
before:

[stextbox id=”grey” shadow=”true”]<div class=”entry-edit-head”>[/stextbox]

insert:

[stextbox id="grey" shadow="true"]<div id="coSamples" style="margin-bottom:15px;"></div>[/stextbox]

and

after:

[stextbox id=”info” shadow=”true”]<script type=”text/javascript”>[/stextbox]

insert:

[stextbox id=”info” shadow=”true”]initOptionsSamples();[/stextbox]

 

Step 3: app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml
find:

[stextbox id=”alert” shadow=”true”]OptionTemplateSelectRow = …[/stextbox]

replace with:

[stextbox id=”info” shadow=”true”]OptionTemplateSelectRow = ‘<tr id=”product_option_{{id}}_select_{{select_id}}”>’+
‘<td>’+
‘<input type=”hidden” name=”product[options][{{id}}][values][{{select_id}}][option_type_id]” value=”{{option_type_id}}”>’+
‘<input type=”hidden” id=”product_option_{{id}}_select_{{select_id}}_is_delete” name=”product[options][{{id}}][values][{{select_id}}][is_delete]” value=””>’+
‘<input type=”text” class=”required-entry input-text select-type-title” id=”product_option_{{id}}_select_{{select_id}}_title” name=”product[options][{{id}}][values][{{select_id}}][title]” value=”{{title}}”>{{checkboxScopeTitle}}</td>’+
‘<td><input type=”text” class=”input-text validate-number product-option-price” id=”product_option_{{id}}_select_{{select_id}}_price” name=”product[options][{{id}}][values][{{select_id}}][price]” value=”{{price}}”></td>’+
‘<td><?php echo $this->getPriceTypeSelectHtml() ?>{{checkboxScopePrice}}</td>’+
‘<td><input type=”text” class=”input-text sku” name=”product[options][{{id}}][values][{{select_id}}][sku]” value=”{{sku}}”></td>’+
‘<td><input type=”text” class=”validate-zero-or-greater input-text sort-order” name=”product[options][{{id}}][values][{{select_id}}][sort_order]” value=”{{sort_order}}”></td>’+
‘<td class=”last”><span title=”Delete row”><?php echo $this->getDeleteButtonHtml() ?></span></td>’+
‘</tr>’;[/stextbox]

 

in the head.phtml, you can find the customOptionsSamples variable where you can set up your own custom options templates.

. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close