Jump to content

Can't import product combinations on 8.1.2


Recommended Posts

Since upgrading to v8.1.2 I can't import product combinations using the csv import option on Prestashop.

I can import products no problem, but as soon as I try to then import the combinations, I get the following error pop up:

Errors occurred:

Technical error: Unexpected response returned by server. Import stopped.

In the console I can see the following error:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '25493-77869-42' for key 'id_product'

This never happened before on v1.7. I'm on php v8.1.

Any idea what the problem could be?

Link to comment
Share on other sites

Thanks. That is the problem. id_product 25493 was there four times. Presumeably from each time I tried to do the import. So I deleted them all and tried the import again. But still it fails with the same message. When I look at the table now, 25493 is there once. The whole row looks to be complete so I am not sure why it is not then going on to process the next product?

Link to comment
Share on other sites

I removed all the modules hooked to actionProductAdd - no difference.

I disabled the modules listed in the Product.php override - no difference.

It seems to add one row fine to ps_products_attributes and then stops. So I can add the combinations one at a time, but as I am trying to upload 300, it will take a very long time doing it that way.

Any other ideas?

Edited by cricket-hockey (see edit history)
Link to comment
Share on other sites

8 hours ago, dnk.hack said:

Also, can you make the SQL dump from ps_product_attributes? 

I want to research bad fields! Sometimes a field can be NULL instead of an empty string or something like that! Or other tables must be repaired.
I have found this guide but never used it. Always try to fix it by myself!


Here is my table


Link to comment
Share on other sites

  • 2 months later...
On 11/8/2023 at 11:54 AM, cricket-hockey said:

I've now bought this module to import products and it works fine: https://addons.prestashop.com/en/data-import-export/24523-easy-import-products-from-csv-excel-xml-json-txt.html

So must be a problem with the default import tool on v8.1?

This module also does not import combinations on Presta 8.1.2.

Any ideas how to fix?


Link to comment
Share on other sites

13 minutes ago, flencas said:

Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '682-1-1' for key 'id_product' SK-A21

Sounds like that combination already exists in the database for that product. Can you select the option to overwrite it, if it already exists?

Link to comment
Share on other sites

21 minutes ago, flencas said:

I'm trying to import multiple combinations for the same item, but the module only imports one. Option is set to update combination if exist.

It work for me so there must be something wrong. I did have this happen to me once actually, but then tried again and it worked. Have you tried deleting the product completely and trying again?

Link to comment
Share on other sites

  • 4 weeks later...

I had the same problem before upgrading to PS8, no matter what I wanted to import I always got the technical error, when I upgraded I had it too but since I was testing PS8 I deactivated most modules and found that I was able to import. You could give it a try, just deactivate non native modules.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...