在Shopware 6中与国家 /地区的进口实体6

发布于 2025-02-11 16:44:57 字数 275 浏览 0 评论 0 原文

我想将客户列表带入国家字符串。

我以前曾将实体进口到ISO守则,但我只是以翻译名称作为该国的标识符而苦苦挣扎。

我在导入配置文件中使用的字段是 defaultshippingaddress.country.translations.en-gb.name 。该字段在导出方面效果很好,但即使在先前导出的文件中也未能导入。我注意到,包含失败导入的表格中包含ID在国家列中的ID,这似乎无效。

是否有正确的方式将实体以国家的名义导入国家?还是我必须使用ID / ISO代码?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

自由如风 2025-02-18 16:44:57

这是不可能的。当您仅通过某些字段进入协会时,它将创建该实体并分配它。您需要事先解决ID,仅引用ID。

有一个问题,可以使用唯一字段来解决此类问题。但是我想这将在不久的将来无法解决

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

在风中等你 2025-02-18 16:44:57

我能够通过将SW国家出口到CSV来解决ID:

SELECT country_translation.country_id, country_translation.name FROM country_translation LEFT JOIN language ON language.id = country_translation.language_id WHERE language.name = 'English';

然后在Excel中使用Vlookup将ID与国家匹配。

I was able to resolve the ID's by exporting the SW Countries into a CSV:

SELECT country_translation.country_id, country_translation.name FROM country_translation LEFT JOIN language ON language.id = country_translation.language_id WHERE language.name = 'English';

And then use VLOOKUP in Excel to match the ID's to the countries.

https://support.microsoft.com/en-us/office/vlookup-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文