Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product "Out of Stock"


Ambassador

Recommended Posts

Posted

I want to display a product as "out of stock", at the moment the sock level is depleting as people oder, with no problems and customers cannot 'checkout' stock we do not have.

 

However when the product level reaches "0" the product is removed from the site (it is still visable in the admin section, set to red)

 

I don't want to display the stock levels of "in stock" items, just those "out of stock"

 

Can someone please help ?

Posted
Can someone please help ?

 

If you change

 

if ($stock_left < 1) {

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

}

 

To

 

// if ($stock_left < 1) {

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

// }

 

Then the stock will keep decrementing but the product will stay availale :)

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Posted

Thanks - looks like that will do it - but how can I mark the product as "out fof stock" - or will they just see that if they try to checkout?

 

Thanks

Posted

The code above worked, but there was an error on the confirmation page until I removed the last few characters.

 

Here is the corrected code:

 

// if ($stock_left < 1) { 

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

// }

--

Harold Corbin

Posted

There was a thread discussing something very similar on the old forums - I think it was actually about having definable shipping times for products, but the results would be the same. I think it got forgotten about when the new forums were put up.

 

We could do with getting this discussion going again. Unless it has been started again elsewhere. Problem is that I think there are a number of different ways of doing it.

 

I handle it by building the product description offline. If the product is in stock it says so and that it will ship within 1-2 days, if it is out of stock it says so and that it will ship in 7 days. All products that are either in stock, or still available are marked as active in the database.

 

To resolve this fully within OSC would require quite a few changes. I guess ideally someone would need to start with writing a mod, which could then be improved upon, prior to be moved in to the cvs. Its on my to do list, but it not very high.

 

Jon.

  • 1 year later...
Posted

Thread revival i know but i can't work out what file the information to edit is in?

 

Could someone tell me please?

  • 1 year later...
  • 3 weeks later...

Archived

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

×
×
  • Create New...