Reputation: 417
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),
query was:
INSERT INTO
catalog_product_link(
product_id,
linked_product_id,
link_type_id) VALUES (?, ?, ?)
While selecting products for related/upsell/crossell shows this error.
Upvotes: 0
Views: 300
Reputation: 417
INSERT INTO
catalog_product_link_type
(link_type_id
,code
) VALUES (1, 'relation'), (3, 'super'), (4, 'up_sell'), (5, 'cross_sell');
This solved the issue.
Upvotes: 3