Hey guys, I want add product as usual but recently I can't add configurable and simple product, and the website shown the below code. I tried to duplicate the existing product and edit it but still can't work. Please help me to fix it.
Many Thanks!
The code: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`verbatim_sg`.`catalog_product_entity`, CONSTRAINT `FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`) O), query was: INSERT INTO `catalog_product_entity` (`entity_type_id`, `type_id`, `created_at`, `updated_at`) VALUES (?, ?, '2019-06-25 01:44:58', '2019-06-25 01:44:58')
HI @mei suet_wong
Which magento version you are using?
How you imported products last time? May be there are some issue with last imported product. Please check once attribute_set_id for id.
Or check your code if you are using any custom module to create or override a file where you are assigning
setAttributeSetId
Try re-indexing once and try.
Hello @mei suet_wong
Are you using any module related to customize the product or attribute set change module?
If yes then check disable that module and check it.
Also, this error happens when somebody removed your attribute set. confirm that attribute set exists or not.
If works then mark as a solution.