Jump to content

Mass default category changing


andreiven

Recommended Posts

Some of my products have as default category the root category which is called 'Categories' (I believe there is yet another root category in which this one lies but that doesn't matter here). I say some of the products because when they were inserted in prestashop some were checked inside their own category and some were checked inside this 'Categories' also.

 

The default category for a product in prestashop is the most parent category in which it lies.

You can change this of course inside the catalog for each product.

 

 

The deal is I have over 2000 products and I don't want to check every product and change the default category if it's necessary.

 

After I uncheck the 'Categories' for a product, the next parent category becomes the default one.

I have found out the id of the 'Categories' which is 2. And I tried using this command inside phpMyAdmin:

update ps_category_product set id_category = replace(id_category, 'Old ID', 'New ID');

 

which is this: update ps_category_product set id_category = replace(1, '2', ' ');

The problem is this doesn't work and I get an error.

 

Does anyone think of another way of doing this?

 

 

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