Jump to content

[solved] quick way to set status


Recommended Posts

Update ps_product set state=1 where XXX

this comend doesn't work, I assume that I have to insert somthing instead of xxx? And you are certain that state is correct name as far as I can see there are no record named state, but I'm no expert in sql

Link to comment
Share on other sites

Sorry I assume that you have SQL knoledge, and the fiels is acvtive... I posted too fast... Sorry.

 

 

If you want to update all products:

update ps_product set active = 1

 

If you want only some id's:

update ps_product set active = 1 where id_product in (1,2,3,....) 

 

If you whant only products form one category (products of a default category):

update ps_product set active = 1 where id_category_default = idnumber of the category

 

And finally if you want producs form any category:

update ps_product set active = 1 where id_product in (Select distinct(id_product) from ps_category_product where id_category = number of the category)

 

 

Hope it helps!

Link to comment
Share on other sites

Sorry I assume that you have SQL knoledge, and the fiels is acvtive... I posted too fast... Sorry.

 

 

If you want to update all products:

update ps_product set active = 1

 

If you want only some id's:

update ps_product set active = 1 where id_product in (1,2,3,....)

 

If you whant only products form one category (products of a default category):

update ps_product set active = 1 where id_category_default = idnumber of the category

 

And finally if you want producs form any category:

update ps_product set active = 1 where id_product in (Select distinct(id_product) from ps_category_product where id_category = number of the category)

 

 

Hope it helps!

 

Hi,

 

Prestashop 1.5

 

ps_product and ps_product_shop

 

Sorry for my English.

Link to comment
Share on other sites

  • 2 weeks later...

done, I have a question is it possible to change this:

update ps_product set active = 1

that it changed status for all products exept products that have id 4, 5, 24, 134?

Try with: 

update ps_product set active = 1 where id_product not in (4, 5, 24, 134)

 

But if there are 4 products only  it's faster to do it manially 

 

P.S: Sorry for the delay. 

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...