Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can you stop people buying out of stock items?


OwenP

Recommended Posts

I have two requirements for my store:

 

- If an item is out of stock, it doesn't show up in the category pages, new items, special offers, "also bought" etc etc.

 

- If an item is out of stock, the customer cannot purchase it (eg if there is only 1 left, they cannot add 2 to their cart).

 

The first one is probably just a case of modifying the MySQL queries to include "where stock > 0" but the second I am not so sure about, as it seems OSC is happy to let you buy the items but tells you they're not immediately available. This is a problem because I will only have small quantities of each item and it is not guaranteed that when an item goes out of stock anymore will be ordered in.

 

If anyone has a solution I would be most appreciative. Thanks.

Link to comment
Share on other sites

Admin > Configuration > Stock > Allow Checkout = False.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Thanks!

 

I just tried that. The thing is, that allows the customer to add the item(s), login/create account, choose a delivery address, and then it tells them the quantity is too many (and doesn't say how many they are able to buy). Is there a better, not so easy way of doing it that will provide a better experience for the customer?

Link to comment
Share on other sites

The only other option is to modify the code to not select products with a quantity of 0.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

But what if there is 1 in stock and the customer attempts to order 2? There needs to be a check at the time of adding to cart whether there is enough to buy.

Link to comment
Share on other sites

  • 2 months later...

Has anyone come up with a solution to this problem? I have the same problem as OwenP above. We have a quantity in stock of 2 and someone wants to order 5. It gives them an error message in the shopping cart... I have "Allow Checkout" set to False, yet they still can checkout with the quantity 5.

 

Any ideas???

Link to comment
Share on other sites

There are several Stock Mods that check stock quantities and display messages etc if you search the contributions .. for example:

 

only_this_many_available v1.1_1

 

I have modified several of these and they seem to be working together very well. If there is something you cannot find dive into it. It's well worth it. When I first started I was so confused .. lol .. but i would say from 6 months to a year I got the Big Picture and before I knew it was practically rewriting my whole site. By studying all the excellent peoples ideas and mods I was able to expand and modify most any to suit my own needs.

 

Its tough at the start but well worth your time in the end. Good luck and Happy Coding :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...