Jump to content

PS 1.7.7.4 - New categories -> update datebase so product are in the new categories


biebel

Recommended Posts

I have added new categories the the webshop.

I would like to migrate the products from the old category to the new category.

I use these queries:

SET @oldCategory = ;
SET @newCategory = ;
INSERT INTO `ps_category_product`
SELECT
    @newCategory,
    id_product,
    position
FROM `ps_category_product`
WHERE id_category = @oldCategory AND id_product NOT IN (SELECT id_product FROM `ps_category_product` WHERE id_category = @newCategory);


UPDATE `ps_product_shop` SET id_category_default = @newCategory WHERE id_category_default = @oldCategory AND id_shop = 1;
UPDATE `ps_product` SET id_category_default=@newCategory WHERE id_category_default=@oldCategory;

DELETE FROM `ps_category_product` WHERE id_category=@oldCategory;

When opening a product in backoffice all the categories are correct but the product doen't show up in the frontoffice when opening the category.

When I open the product in backoffice, push save without any modification, the product is shown in front office.

What am I missing?

Kind regards

Bart

Edited by biebel (see edit history)
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...