Guest Posted February 4, 2003 Share Posted February 4, 2003 Hi. This is what I am looking for. I need the qty of a product to decrease when its ordered, but when the qty reach to zero, I want the qty to stay at zero and stay in stock while letting customers to place order. The qty at 0 will stay and no more subtraction will be made, if someone place an out of stock order for the item. Any contributions? Quote Link to comment Share on other sites More sharing options...
netguru Posted February 4, 2003 Share Posted February 4, 2003 Please modify the following lines in checkout_process.php // do not decrement quantities if products_attributes_filename exists if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ($stock_left < 1) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } Mark the line as follows: if ($stock_left < 1) { # tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } I hope it is helpful! :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.