Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Out of stock items showing


crazymonkey

Recommended Posts

Posted

Hi,

 

My OSC site recently went live and I had my first order yesterday, but I have a weird problem.

 

When I tested the site, it would stop out of stock products displaying in the catalog. Now when the quatity hits 0 the item is still displayed.

 

I dont think I have changed any settings since the site went live that would effect this. Does anyone have any ideas?

 

Thanks in advance.

 

Dave.

Posted

By default, osC displays items with 0 stock so unless you had changed it previously, it always displayed out-of-stock items.

 

This was discussed on the forums in the last week or 2. Do a search ... there's a quick fix to have product status set to 0 (inactive) automatically when stock hits 0. :)

Posted

The site was definately not showing out of stock items a while ago, so I may have changed something previously, but I have seen a few posts saying that OSC does not display out of stock items by default.

 

I cant seem to find the other thread... Do you know roughly what the title was?

 

 

Thanks for your help

 

Dave.

Posted
The site was definately not showing out of stock items a while ago, so I may have changed something previously, but I have seen a few posts saying that OSC does not display out of stock items by default.

 

I cant seem to find the other thread... Do you know roughly what the title was?

 

 

Thanks for your help

 

Dave.

osC (by default) will always show items, regardless of stock quantity until you manually change the item status. However, you can set in admin whether or not you want to allow checkout on out-of-stock items.

 

manuman posted this in the other thread as a fix:

 

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...