Magento 无法将产品关联、追加销售、交叉销售。显示错误
Magento Cannot products to related,upsell,crossell. showing error
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
update a child row: a foreign key constraint fails
(cl55-m755
.catalog_product_link
, CONSTRAINT
FK_CAT_PRD_LNK_LNK_TYPE_ID_CAT_PRD_LNK_TYPE_LNK_TYPE_ID
FOREIGN KEY
(link_type_id
) REFERENCES catalog_product_link_type
(link_type_id
) ON),
查询是:
INSERT INTO
catalog_product_link(
product_id,
linked_product_id,
link_type_id) VALUES (?, ?, ?)
为 related/upsell/crossell 选择产品时显示此错误。
INSERT INTO catalog_product_link_type
(link_type_id
, code
)
VALUES (1, 'relation'), (3, 'super'), (4, 'up_sell'), (5,
'cross_sell');
这解决了问题。
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (
cl55-m755
.catalog_product_link
, CONSTRAINTFK_CAT_PRD_LNK_LNK_TYPE_ID_CAT_PRD_LNK_TYPE_LNK_TYPE_ID
FOREIGN KEY (link_type_id
) REFERENCEScatalog_product_link_type
(link_type_id
) ON),
查询是:
INSERT INTO
catalog_product_link(
product_id,
linked_product_id,
link_type_id) VALUES (?, ?, ?)
为 related/upsell/crossell 选择产品时显示此错误。
INSERT INTO
catalog_product_link_type
(link_type_id
,code
) VALUES (1, 'relation'), (3, 'super'), (4, 'up_sell'), (5, 'cross_sell');
这解决了问题。