1

Is there a way to automagically create variants from a Google Sheet when importing via Feed Me?

The docs at https://docs.craftcms.com/feed-me/v4/guides/importing-commerce-variants.html#setup-your-feed only mention JSON and XML

Thanks :)

EDIT FOR CLARITY: I can't figure out how to relate a Variant row in the spreadsheet to the parent Product row, I guess this is inherent in XML/JSON because of the nested structure...

2
  • fwiw those pages under Guides all mention just XML or JSON, but according to this page of the docs you should be able to use Google Sheets, and I would imagine for any of the content types they have specific guides on. ¯\_(ツ)_/¯ Mar 2 '20 at 16:01
  • Thanks @JalenDavenport - I can't figure out how to relate a Variant row in the spreadsheet to the parent Product row, I guess this is inherent in XML/JSON because of the nested structure... Mar 2 '20 at 16:36
1

The solution at https://github.com/craftcms/feed-me/issues/368#issuecomment-555710613 works just fine.

(Mentioning this in the docs would be good :)

I didn't bother with step 7 as it seems the first line automatically becomes the default variant if one isn't set.

1. Create a new custom field e.g. "Import ID" and add it to the product type that has variants
2. Create new line for each product variant.
3. Make sure "Import ID" is the same for variants of the same product (But unique for each product).
4. Under "Import Strategy" of Feed Me check both: "Create new elements" and "Update existing elements".
5. Under "Set a unique identifier to match against existing elements" check the field you created in step 1: eg. "Import ID".
6. Map all other fields as you would normally do with a non-variant import.
7. Make sure you have an extra column for the "Is Default" field and that only one of the variants has that value to set to 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.