Home Ask Login Register

Developers Planet

Your answer is one click away!

Shumaise Mohammed February 2016

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.


Shumaise Mohammed February 2016

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.

Post Status

Asked in February 2016
Viewed 2,597 times
Voted 5
Answered 1 times


Leave an answer

Quote of the day: live life