Page 1 of 1
Set default quantity for product options in admin area
Posted: Thu Aug 04, 2011 5:49 pm
by danicmyk
I have just solved the issue of setting subtract stock default as no but now i need to set the default quantity for each option to 1000. I have also done this with the main quantity for each product through the controller but it doesn't seem to work for the product options. anyone have a solution?
Re: Set default quantity for product options in admin area
Posted: Thu Aug 04, 2011 5:58 pm
by danicmyk
Nevermind! managed to solve my own problem (was extremely simple too)
Find:
Code: Select all
html += ' <td class="right"><input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][quantity]" value="" size="3" /></td>';
change to:
Code: Select all
html += ' <td class="right"><input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][quantity]" value="1000" size="3" /></td>';
simple! hopefully this will come in handy for others with the same issue.
Re: Set default quantity for product options in admin area
Posted: Fri Feb 10, 2012 1:20 pm
by info@skatenutter.com
So where do we get the code?
Re: Set default quantity for product options in admin area
Posted: Sat Jul 28, 2012 10:25 pm
by hellreturn
In which file you need to edit above code?
Thanks!
Re: Set default quantity for product options in admin area
Posted: Sun Jul 29, 2012 1:22 am
by straightlight
It looks like the code above needs to be edited from your admin/view/template/catalog/product_form.tpl file. The product option is not being used elsewhere in the admin on anyhow.
Re: Set default quantity for product options in admin area
Posted: Wed Apr 30, 2014 3:30 pm
by FloM
Hi,
Maybe it's late, or maybe someone is searching for something like this...
To change the default quantity in the "Data" tab of the admin page when inserted a new product:
go to: admin/controller/catalog/product.php
find this:
Code: Select all
if (isset($this->request->post['quantity'])) {
$this->data['quantity'] = $this->request->post['quantity'];
} elseif (!empty($product_info)) {
$this->data['quantity'] = $product_info['quantity'];
} else {
$this->data['quantity'] = 1;
}
lines 899 - 905
replace line 904
with
Code: Select all
$this->data['quantity'] = "YOUR VALUE HERE";
Have fun!
Re: Set default quantity for product options in admin area
Posted: Wed Apr 30, 2014 11:49 pm
by rph
This is also one of the features of Admin Enhancement Suite.
http://www.opencart.com/index.php?route ... on_id=5883