I'm trying to update configurable associated products. When I save my product I get this error:
Integrity constraint violation: 1062 Duplicate entry '183-137' for key 'UNQ_CATALOG_PRODUCT_SUPER_ATTRIBUTE_PRODUCT_ID_ATTRIBUTE_ID'
, query was: INSERT INTO `catalog_product_super_attribute` (`product_id`, `attribute_id`) VALUES (?,
?)<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
How can I update the configurable associated products?
Best Answer
i use this code to insert and update configurable product in my custom extention.
where all data get in data variable
$pid is configurable product id.
$aid is attribute id.
before you use this code u set session variable is edit to 0 or 1. 0- if new product , 1- if edit existing product