It might be quite a simple question, but I've found no valid related answer yet.
I'm trying to import sales prices from CRM with a custom module.
$item->setData('group_price', array(array ('website_id'=>0, 'cust_group'=>$custGroup->getId(), 'price'=>$price->precio)));
But when the price for the customer group does exist I get the following error:
SQLSTATE: Integrity constraint violation: 1062 Duplicate entry '14729-0-784-0' for key 'CC12C83765B562314470A24F2BDD0F36'
I've tried several things, including obtaining existing data with:
$group_prices = $item->getData('group_price');
in order to merge results with the new one, deleting all group prices before I set them again. But I don't seem to get the group prices array I was expecting...
Can anyone help to get this solved?