Jump to content

SQL code for Deny Order when out of stock


sipdorus

Recommended Posts

It's the out_of_stock field in the ps_stock_available table. You can use a query like the following to change them all to "Deny":
UPDATE `ps_stock_available` SET `out_of_stock` = 0

Though this won't affect new products you create.

 

It might be better to go to the Preferences > Products tab and change "Allow ordering of out-of-stock products" to "No". Then all new products will have "Deny" by default. Then you could use the following query to change all products to use that setting:

UPDATE `ps_stock_available` SET `out_of_stock` = 2

Then you can easily switch all products between "Deny" and "Allow" directly from the Back Office.

Link to comment
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
×
×
  • Create New...