Jump to content

How to activate all products that are greater than 0 stock>?


liuksas

Recommended Posts

Hello,

The following SQL update query should do the trick for you:

UPDATE `ps_product_shop` PS, `ps_stock_available` SA
SET PS.`active` = '1'
WHERE PS.`id_product` = SA.`id_product`
AND SA.`quantity` > 0;

This is not taking into account the store. If you run a multistore environment and want to update only a single store, you will have to add an additional check for that.

  • Like 1
Link to comment
Share on other sites

its working thanks for help Andrei H 😀

the problem is that I need to transfer 20k products and I split the xml into parts and when several parts are turned off all the other products... but now I know the SQL command to turn them all on

 

  • Like 1
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...