I have 2000+ products all set to simple products but with custom options.

An option is a drop-down option with an SKU etc... What I want to know is, is it possible to add another input box after 'Sort Order' to say 'stock count'??

I'm using Magento

Current Custom Options

  • 1
    version please and could you share me any screenshot where you exact want to add? Commented Feb 14, 2017 at 12:19
  • you want to add it as order attribute or product attribute ? Commented Feb 14, 2017 at 12:20
  • @NAGARAJUK I've added this.
    – WebDevB
    Commented Feb 14, 2017 at 12:38
  • @VishwasBhatnagar product option.
    – WebDevB
    Commented Feb 14, 2017 at 12:39
  • Sure I will help you. Commented Feb 14, 2017 at 13:40

1 Answer 1


Please follow the below steps:



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();

enter image description here

enter image description here

Step 2:


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

enter image description here

Finally clear cache and session


corrected the links

  • You should never modify core code! Extend the classes instead. And do not extend the database table directly, always use setup scripts!
    – Black
    Commented Oct 23, 2018 at 10:53
  • yes i will follow @Black thanks for your suggestion Commented Oct 23, 2018 at 11:12

Your Answer

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

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