Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Status Problem wth Stock


theseason

Recommended Posts

Posted

When a product is purchased on our site, the site will decrease the quanity. However, when the quantity left is zero, it will not change the product status to out of stock so that the product will be removed from display. Here are my settings in the stock admin menu:

 

check stock level true

subtrack stock true

allow checkout false

mark out of stock ***

 

Most of the products are unique and have only one item available. What should I do? I am using the Paypal IPN contribution as well.

 

Thanks for the help in advance

 

*theseason

Posted

I believe that is how the default osC functions. If you would like it to check stock before displaying an item, you would need to add some code so it doesn't display if stock < 1

Posted

So, oscommerce by default, will not change the status of an item automatically. That seems backwards. I have no idea of where or how to add code so that the product will not display in the list if there is no stock.

 

Thanks for the info.

 

*theseason

Posted

Try this...

 

In checkout_process.php find...

 

        tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

 

Immediately after that insert...

 

if ($stock_left < 1) {

         tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

       }

 

this is from a july 2003 release of OSC if yours is no longer using tep then just replace function name as required.

 

Might Help :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...