规则条件是Category is 42,分类页上的可配置商品也在42里,简单商品选项却没有折扣。这里容易忽略:父商品负责展示,最终价格常来自子商品;子商品自己未分配分类时,按Category判断可能匹配不到。
SELECT product_id,category_id FROM catalog_category_product WHERE product_id IN (<parent_id>,<child_id>) ORDER BY product_id; bin/magento catalog:rule:apply bin/magento indexer:reindex catalogrule_rule catalogrule_product catalog_product_price
不要为了促销把所有子商品都展示到分类。可以让子商品保持Not Visible Individually,但按业务需要建立分类关联;或者改规则条件,使用明确的商品属性而不是依赖分类关系。属性要启用Use for Promo Rule Conditions。
别混淆Cart Rule
Catalog Price Rule在商品价格阶段生效,Cart Price Rule在quote阶段生效。测试时先看商品页final_price,再看购物车discount_amount。两个规则同时存在会让人以为其中一个失效。
修改后要在每个Website和客户组测试,尤其是父商品无价格、子商品有tier price的情况。索引表里父子最终价正确,前台才会稳定。

