It is common for companies with a huge product database to always have an ERP that manages their product updates. With an external service, it normally utilises the built-in Magento API. Calling the method catalogProductCreate using a SOAP service, one of the possible issues that may arise is the one below:

catalogProductCreate Error:

SQLSTATE23000: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`db`.`catalog_product_super_link`, CONSTRAINT `FK_CAT_PRD_SPR_LNK_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE)

An empty url_key value causes the above issue. To fix it, make sure that the configurable product being created has a valid url_key. This is required for any product that is available on both catalog and search listings as shown below:

url_key field in catalogProductCreate SOAP request

Do not forget that a url_key needs to be unique because this is used to generate the hyperlink of the product.

About the author

Richard Feraro is a Magento Enterprise Certified developer from Manila, Philippines with 14 years of solid open-source development experience using Linux, Apache, MySQL & PHP.

By Richard Feraro

Richard Feraro is a Magento Enterprise Certified developer from Manila, Philippines with 14 years of solid open-source development experience using Linux, Apache, MySQL & PHP.

Leave a Reply