Tuesday, 23 January 2018

How to add Custom Options - Drop Down add field in magento 1.9


How to add Custom Options - Drop Down add field in magento 1.9
Step1:
app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php

you have to modify the code in the line numbers 263 and 287 (or)
search sku as keyword, based on that just keep below code.

line number 263
'stockcount' => $_value->getStockcount(),

and in the line number 287
$value['stockcount'] = $option->getStockcount();

Step 2:
/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml
line number 42 add below code
'<th class="type-stockcount"><?php echo Mage::helper('core')->jsQuoteEscape(Mage::helper('catalog')->__('Stock Count')) ?></th>'+

line number 67
+'<td><input type="text" class="validate-zero-or-greater input-text" name="product[options][{{id}}][values][{{select_id}}][stockcount]" value="{{stockcount}}"></td>'+

Step 3:
finally you should add create a column 'stockcount' in the database table called catalog_product_option_type_value as shown in the below screenshot

No comments:

Post a Comment