Post by reflexweb » Mon Sep 26, 2016 3:36 am

Hi Everyone

Hope one of you can help point me in the right direction.

Im using OC Version 2.3.0.2

When creating and editing products, we use a lot of options. These options are always in stock and do not stock control.

As such, we are having to type 1000 in the qty field and selecting 'subtract stock' to no for each and every option.

So my question is, where can i alter the code to default the qty of an option to 1000 and No to subtract stock.

Image


Many Thanks
Roger

New member

Posts

Joined
Thu Jun 28, 2012 8:06 pm

Post by IP_CAM » Mon Sep 26, 2016 7:35 am

This may be a very BRUTAL and unprofessional way, of doing this, but in my OC 2.2, it works at least! :D
---
oc22\admin\view\template\catalog\product_form.tpl

Code: Select all

Line 1267:
html += '  <td class="text-right"><input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][quantity]" value="1000" placeholder="<?php echo $entry_quantity; ?>" class="form-control" /></td>';
Line 1269:
html += '    <option value="0"><?php echo $text_no; ?></option>';
Line 1270:
html += '    <option value="0"><?php echo $text_no; ?></option>';
Good Luck ;)
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by reflexweb » Thu Oct 06, 2016 11:39 pm

Thanks the above failed, but thank you as your reply put in the right location. Changes to code as below fixed the default values i needed. :)

Code: Select all

LINE 1270:	
html += '  <td class="text-right"><input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][quantity]" value="1000" placeholder="<?php echo $entry_quantity; ?>" class="form-control" /></td>';
LINE 1272:
html += '    <option value="0"><?php echo $text_no; ?></option>';
LINE 1273:
html += '    <option value="1"><?php echo $text_yes; ?></option>';
Many Thanks

New member

Posts

Joined
Thu Jun 28, 2012 8:06 pm

Post by mianbao » Sun Jan 15, 2017 5:06 pm

did it in my 2.3.0.2 and see no outcome/change

New member

Posts

Joined
Fri Jul 15, 2016 9:57 am

Post by cyclops12 » Mon Jan 16, 2017 4:25 am

mianbao wrote:did it in my 2.3.0.2 and see no outcome/change
You will need to goto extensions/modifications and click refresh then you will see the change when you add a new option to a product

You will not see the changes in options already set, only when you add a new option will you see the changes

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am
Who is online

Users browsing this forum: No registered users and 9 guests