Page 1 of 1
how to set Subtract Stock = No to default?
Posted: Wed Jan 05, 2011 3:57 am
by seachen
i need to set Subtract Stock = no, everytime i add product
how to make it default Subtract Stock = no?
Re: how to set Subtract Stock = No to default?
Posted: Wed Jan 05, 2011 5:43 am
by mystifier
You will need to do this with a database management tool (eg. phpMyAdmin).
In the `Product` table definition, change the default value of the `Subtract` field from 1 to 0
Re: how to set Subtract Stock = No to default?
Posted: Wed Jan 05, 2011 6:24 am
by Qphoria
No.. he means the default.
1. EDIT: admin/controller/catalog/product.php
2. FIND:
$this->data['subtract'] = 1;
3. REPLACE WITH:
$this->data['subtract'] = 0;
Re: how to set Subtract Stock = No to default?
Posted: Wed Jan 05, 2011 12:08 pm
by seachen
thanks. a lot
Re: how to set Subtract Stock = No to default?
Posted: Thu Oct 13, 2011 11:01 am
by ahdindy
Thanks, that was helpful for future products, but I have close to 600 products that I would like to change the Subtract Stock option on (in the Data tab) from Yes to No...is there any quicker way to do that than going in one by one and changing the status?
Thanks!
Re: how to set Subtract Stock = No to default?
Posted: Thu Oct 13, 2011 5:40 pm
by SXGuy
refer to first answer, change the field from 1 to 0 using phpmyadmin. Or install export/import tool and use the exported spreadsheet and mass change the column for subtrack stock.
Re: how to set Subtract Stock = No to default?
Posted: Thu Oct 13, 2011 7:04 pm
by ahdindy
SXGuy wrote:refer to first answer, change the field from 1 to 0 using phpmyadmin. Or install export/import tool and use the exported spreadsheet and mass change the column for subtrack stock.
Thanks...I did that but the Subtract Stock still didn't change for the products in the admin area. Did I do something wrong?
Re: how to set Subtract Stock = No to default?
Posted: Thu Oct 13, 2011 7:24 pm
by ahdindy
I did some thinking and finally just edited the code. I went to:
catalog\view\theme\default\template\checkout\cart.tpl
And deleted the lines:
<?php if (!$product['stock']) { ?>
<span style="color: #FF0000; font-weight: bold;">***</span>
<?php } ?>
Which gets rid of the asterisks after the product name - crude, I know, but effective

If you use a different template you'll need to do that in the active template, not in the default theme.
Re: how to set Subtract Stock = No to default?
Posted: Tue Jan 17, 2012 4:19 pm
by haydent
Qphoria wrote:No.. he means the default.
1. EDIT: admin/controller/catalog/product.php
2. FIND:
$this->data['subtract'] = 1;
3. REPLACE WITH:
$this->data['subtract'] = 0;
this worked fine thankyou.
Re: how to set Subtract Stock = No to default?
Posted: Wed Feb 08, 2012 4:39 pm
by thbr02
Is there anyway to change the subtract stock default for the option stock as well?
Re: how to set Subtract Stock = No to default?
Posted: Thu Jun 14, 2012 5:32 pm
by kotysoft
thbr02 wrote:Is there anyway to change the subtract stock default for the option stock as well?
Simply change the order of lines
(yes, no >> no, yes)
Find
admin/view/template/catalog/product_form.tpl
Code: Select all
html += '<td class="left"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][subtract]">';
html += ' <option value="1"><?php echo $text_yes; ?></option>';
html += ' <option value="0" ><?php echo $text_no; ?></option>';
html += ' </select></td>'
Modify
Code: Select all
Find
======================================
html += '<td class="left"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][subtract]">';
html += ' <option value="0" ><?php echo $text_no; ?></option>';
html += ' <option value="1"><?php echo $text_yes; ?></option>';
html += ' </select></td>'
Re: how to set Subtract Stock = No to default?
Posted: Thu Jun 14, 2012 11:23 pm
by rph
thbr02 wrote:Is there anyway to change the subtract stock default for the option stock as well?
If you don't feel like editing code yourself there's also
Admin Enhancement Suite which allows you to set subtract stock defaults for product and option quantities.
Re: how to set Subtract Stock = No to default?
Posted: Sun Jun 24, 2012 11:34 pm
by xlam
Qphoria wrote:No.. he means the default.
1. EDIT: admin/controller/catalog/product.php
2. FIND:
$this->data['subtract'] = 1;
3. REPLACE WITH:
$this->data['subtract'] = 0;
working for me

Re: how to set Subtract Stock = No to default?
Posted: Mon Jun 25, 2012 1:01 am
by Avvici
rph wrote:thbr02 wrote:Is there anyway to change the subtract stock default for the option stock as well?
If you don't feel like editing code yourself there's also
Admin Enhancement Suite which allows you to set subtract stock defaults for product and option quantities.
Is there an extension that you "don't" have?

Re: how to set Subtract Stock = No to default?
Posted: Fri Nov 20, 2015 8:56 am
by neljan
Thanks very much Qphoria. I found this thread looking for an answer to the same question.
In 2.0.x it's slightly different:
1. EDIT: admin/controller/catalog/product.php
2. FIND:
$data['subtract'] = 1;
3. REPLACE WITH:
$data['subtract'] = 0;
Cheers!
Re: how to set Subtract Stock = No by default?
Posted: Thu Sep 28, 2023 8:08 pm
by parkookk
Hi, I use OC3038 and would like the Subtract Stock to be NO by default as I it's a website that sells services.
The solution above doesn't work with my OC.
Many Thanks
Re: how to set Subtract Stock = No by default?
Posted: Thu Sep 28, 2023 8:30 pm
by WaxedPerfection
parkookk wrote: ↑Thu Sep 28, 2023 8:08 pm
Hi, I use OC3038 and would like the
Subtract Stock to be
NO by default as I it's a website that sells services.
The solution above doesn't work with my OC.
Many Thanks
carnt you just set your stock levels to 999999 rather than tinkering? seems a better option to me and future proof.
i carnt remeber if OC 3.0.3.8 has in each product the option to "Subtract Stock" set to NO under the data tab.
(update on my part - Yes it does under that data the tab)
Re: how to set Subtract Stock = No by default?
Posted: Fri Sep 29, 2023 7:19 am
by ADD Creative
parkookk wrote: ↑Thu Sep 28, 2023 8:08 pm
Hi, I use OC3038 and would like the
Subtract Stock to be
NO by default as I it's a website that sells services.
The solution above doesn't work with my OC.
Many Thanks
Did you refresh modifications?