Shumaise Mohammed
Shumaise Mohammed

Reputation: 417

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),

query was:

INSERT INTOcatalog_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

Answers (1)

Shumaise Mohammed
Shumaise Mohammed

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

Related Questions