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
In the `Product` table definition, change the default value of the `Subtract` field from 1 to 0
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
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!
Thanks!
Thanks...I did that but the Subtract Stock still didn't change for the products in the admin area. Did I do something wrong?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.
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.
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

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.
Simply change the order of linesthbr02 wrote:Is there anyway to change the subtract stock default for the option stock as well?
(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>'
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>'
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.thbr02 wrote:Is there anyway to change the subtract stock default for the option stock as well?
-Ryan
working for meQphoria 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;

Baju Muslim Baju Pria Baju Anak Baju Korea Sparepart Printer Baju Muslim JNE Surabaya
Is there an extension that you "don't" have?rph wrote: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.thbr02 wrote:Is there anyway to change the subtract stock default for the option stock as well?

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!
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!
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
The solution above doesn't work with my OC.
Many Thanks
I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)
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)
https://www.waxedperfection.co.uk/ Car Detailing Product Blog's and Review's
Did you refresh modifications?
Who is online
Users browsing this forum: No registered users and 94 guests