Shopify 2022 年 1 月 API 发布后,presentmentprices 字段被弃用后,如何同步价格
Shopify 在新版本发布后将弃用某些字段。 弃用 他们的文档建议我们应该走向国际化。
但这种向国际化的转变在我的数据库中支持有点令人困惑。 主要原因是,GraphQL API 需要国家/地区代码作为上下文变量,如果我获取可用国家/地区的列表,我会得到以美元作为所有这些国家/地区的默认货币的国家/地区的完整列表。
现在我面临的主要问题是,我将不得不请求每个国家/地区每个产品/产品变体的价格,这将:
A:永远需要同步,而且还会发生很多限制问题
B:我的数据库将充满冗余和默认数据。
我可能可以检查美元作为默认国家,并查看一个国家的主要货币应该是或不应该是美元,以跳过其中很多国家,但这感觉不是一个可靠的方法。我是否缺少一些其他 API,它可以帮助我将国家/地区列表过滤到仅由商店实际支持的国家/地区。
如果还有其他更好的方法与 Shopify 同步价格,我会洗耳恭听。
Shopify is deprecating some fields after their new release. deprecations
Their docs suggest we should move towards internationalization.
But this shift towards internationalization is a bit confusing to support in my database.
The main reason being, that the GraphQL API expects a country code as the context variable, and if I fetch a list of available countries, I get a complete list of countries with USD as the default currency of all these countries.
Now the main issue that I am facing is that, I will have to request prices per Product/ProductVariant per country, which will:
A: take forever to sync, plus a lot of throttling issues will also occur
B: My database will be filled with redundant and default data.
I can probably check for USD as a default country and see the primary currency of a country should be or should not be USD, to skip a lot of these countries, but this doesnt feel like a solid approach. Am I missing some other API which will help me filter the list of countries to those countries only, that are actually supported by a store.
If there are other better approaches to sync prices with shopify, I am all ears.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论