如何通过查询将商品归类
How to put products in a category by query
我需要在我的 prestashop (v1.5) 商店中自动将产品(ID 10233 到 10247)放入主页类别(id=2)。
也许 sql 更容易,不是吗?
表格:
- ps_product_shop - id_product, ...
- ps_category_product(枢轴)- id_category、id_product、...
- ps_category - id_category, ...
INSERT INTO ps_category_product (id_category,id_product)
SELECT 2, ps_product_shop.id_product
FROM ps_product_shop
WHERE ps_product_shop.id_product > 10232 AND ps_product_shop.id_product < 10248
我想这样的东西可能就是你想要的
我需要在我的 prestashop (v1.5) 商店中自动将产品(ID 10233 到 10247)放入主页类别(id=2)。
也许 sql 更容易,不是吗?
表格:
- ps_product_shop - id_product, ...
- ps_category_product(枢轴)- id_category、id_product、...
- ps_category - id_category, ...
INSERT INTO ps_category_product (id_category,id_product)
SELECT 2, ps_product_shop.id_product
FROM ps_product_shop
WHERE ps_product_shop.id_product > 10232 AND ps_product_shop.id_product < 10248
我想这样的东西可能就是你想要的