Jump to content
khoking

Do not allow checkout IF STOCK = -101

Recommended Posts

Hi,

 

I use stock quantity to control my stock status. I set my stock quantity to -100 for items that only have ONE unit. So when customer ordered, it automatically becomes -101 stock quantity.

 

I want to DISALLOW checkout if the stock is -101.

 

May I know how can I do that? Where to edit? Is it Checkout Process? Shopping Cart?

 

Please help.


Best regards,

Koh Kho King

Share this post


Link to post
Share on other sites

Doesn't the stock go down when ordered? Have you tried setting the quantity to 1 and then change the stock settings so checkout is not allow if the quantity is 0? That's the normal way of doing it, unless I'm not understanding the question.

Share this post


Link to post
Share on other sites

Doesn't the stock go down when ordered? Have you tried setting the quantity to 1 and then change the stock settings so checkout is not allow if the quantity is 0? That's the normal way of doing it, unless I'm not understanding the question.

 

Hi Jack,

 

Thanks very much for replying.

 

I do understand that OSC has the feature to disallow checkout when the quantity becomes 0, but I do not want to disallow checkout for that.

 

I only want to have a clause where when quantity becomes -101, checkout is disallowed. I only want to disallow checkout when the quantity is -101. The reason I want so is that for product that I only have ONE unit stock, I can set the stock quantity to -100, and when someone ordered, it becomes -101 and others will not be able to order again.


Best regards,

Koh Kho King

Share this post


Link to post
Share on other sites

@@khoking

 

That makes NO sense. If you have ONE item, set the quantity to ONE.. Once it is sold, that's it !

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

Sounds looney to me as well but try this in checkout_process.php

 

Change

 

// Out of Stock

if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) {

 

to

// Out of Stock

if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true)|| tep_get_products_stock($products_id) == -101 ) {

 

HTH

 

G


Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×