现象:通过REST或脚本关联子SKU时返回属性不匹配,不能跳过校验直接写catalog_product_super_link,否则前台组合会损坏。

阶段具体操作
取证读取父商品catalog_product_super_attribute,列出全部超级属性;确认子商品Attribute Set包含的是同一个attribute_id。
定位检查子商品默认范围属性值,可配置属性必须为Select且保存有效option_id,不能写显示标签。
修复确认父子商品分配到兼容Website,子商品类型与启用状态符合要求。
复核修复属性并保存子商品后,再调用ConfigurableProductLinkManagement或标准REST接口关联并重建相关索引。

可执行检查

SELECT product_id,attribute_id FROM catalog_product_super_attribute WHERE product_id=:parent_id;
SELECT entity_id,attribute_set_id,sku,type_id FROM catalog_product_entity WHERE sku IN ('PARENT','CHILD-1');

通过标准:父商品variants包含新子SKU,前台每个属性组合唯一,价格和可售状态均来自正确子商品。