Search code examples
shopwareshopware6

Import entities with country as string in Shopware 6


I would like to import a customer list with countries as string.

I have imported entities with the countries ISO code before, but I am struggling with just the translated names as the identifier for the country.

The field which I use in my import profile is defaultShippingAddress.country.translations.en-GB.name. This field works perfectly fine on export, but fails on import - even with the previously exported file. I noticed, that the sheet containing the failed imports has Ids in the country column, that do not seem to be valid.

Is there a correct way to import entities with countries by the country name? Or do I have to use an Id / Iso code?


Solution

  • This is not possible. When you pass in an association just some fields, it will create that entity and assign it. You need to resolve the ID beforehand and reference only the ID.

    There is an issue open to allow referencing using unique fields, to solve issues like this. But I guess this will be not solved in near future