How to remove all catalog products in Magento

前端 未结 6 1491
一个人的身影
一个人的身影 2021-02-04 17:42

I\'ve trying to import a products list to magento. In the firsts test, I got success, but the products were not showing up in back or front office.

After redo the impor

6条回答
  •  死守一世寂寞
    2021-02-04 18:15

    With your SQL-Sql Script i broke my price index. This happens because we use group prices in the shop. Following error occurred every timewhen i tried to reindex the index "catalog_product_price":

    SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails     (`db`.`catalog_product_index_group_price`, CONSTRAINT `FK_CAT_PRD_IDX_GROUP_PRICE_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`), query was: INSERT INTO `catalog_product_index_group_price` SELECT `gp`.`entity_id`, `cg`.`customer_group_id`, `cw`.`website_id`, MIN(IF(gp.website_id = 0, ROUND(gp.value * cwd.rate, 4), gp.value)) FROM `catalog_product_entity_group_price` AS `gp`
     INNER JOIN `customer_group` AS `cg` ON gp.all_groups = 1 OR (gp.all_groups = 0 AND gp.customer_group_id = cg.customer_group_id)
     INNER JOIN `core_website` AS `cw` ON gp.website_id = 0 OR gp.website_id = cw.website_id
     INNER JOIN `catalog_product_index_website` AS `cwd` ON cw.website_id = cwd.website_id WHERE (cw.website_id != 0) GROUP BY `gp`.`entity_id`,
            `cg`.`customer_group_id`,
            `cw`.`website_id` ON DUPLICATE KEY UPDATE `price` = VALUES(`price`)
    

    Please add following line:

    TRUNCATE TABLE `catalog_product_entity_group_price`;
    

提交回复
热议问题