Jump to content

Edit History

biebel

biebel

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

biebel

biebel

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);

SET @oldCategory = ;
SET @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

biebel

biebel

We have added new categories the the webshop.

We would like to migrate the prodacts from the old category to the new.

We 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);

SET @oldCategory = ;
SET @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 we open the product, push save without any modification. The product is shown in front office.

What am I missing?

Kind regards

Bart

×
×
  • Create New...