Question

I would like to ask how can I update certain fields of my products like prices,images,stats? Notice that I have around 6.000 products.I tried the same way that I imported them but I get this error SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry for key 2.So actually the module finds a duplicate to the SKU and does not update the field.As the way i want is the module to see the SKU and then update the fields of the certain products something like overwrite.Any ideas?

Était-ce utile?

La solution

I think commerce_product_save will do the task for you. The function is very similar to node_save.

You can have csv of all the changes. While importing check if the SKU is present, if yes then use this function to update the existing product. Else you can create a new product.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top