Importing product variants with multiple attributes

Closed

Import WP Addon - WooCommerce Updated 5 months ago 4 Replies

Stefan asked 5 months ago on September 4, 2024 at 10:30 am

Hi,

I am importing variable products, where some have one attribute (such as \”size word\”), but others have two (such as \”size\” and \”color\”). If I import only the products with 2 attributes, everything works fine, but if I use the same importer for the products with only a single attribute I get this error:

The parent imports fine, but the children don’t. Here is the field list I am using:

For now, I could copy the importer and delete the second attribute list, but this seems cumbersome to me.

Is there a trick that I can apply, so I can use the same importer for both products?

Cheers

Stefan

 

SL

Stefan replied

5 months ago on September 4, 2024 at 10:30 am

J

James replied Support Agent

5 months ago on September 4, 2024 at 9:07 pm

Hi Stefan,

The problem is caused because you are setting the attribute to be "used for variations", there might be a way to set this to yes or no based on your csv file.

Are you able to provide your csv and export and attach your importer settings to this ticket by going to Tools > Import WP > Settings / Tools > Import / Export and select and export your importer as a JSON file.

James

J

James replied Support Agent

5 months ago on September 4, 2024 at 9:37 pm

As an example with the attached sceenshot of a csv and other attachments, using field mapping (https://www.importwp.com/docs/template-fields/#mapping-fields) to set the "used for variations?" to yes or no depending on if the column is empty or not, products with 1 or 2 attributes to work.

James

SL

Stefan replied

5 months ago on September 5, 2024 at 4:14 am

Hi James,

Perfect, this worked. The only thing I had to do is put a field mapping on the actual attribute name and return the string "EMPTY" if there was no attribute specified, as it reads the attribute from a column, and the importer insisted on this value being present. Once I did that, everything worked.

Congratulations on a great plugin, at first, I was sceptical if it would provide the benefits I was looking for, but since I have used it more extensively it has been invaluable. Well done!

Best Regards

Stefan