问题标签 [custom-sections]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
28 浏览

asp.net - Shopify 请求根据语言的用户更改部分

我希望你做得很好。我在我的 Shopify 商店中工作,我正在通过我创建并添加到 product.liquid 的部分使用产品描述。我正在尝试根据客户使用的语言修改描述,以便以不同的语言显示描述。

这是我正在使用的代码:

因此,当我使用 {% if request.host contains 'storename.com/es' %} 时,棘手的部分就来了语言,使用 {% if product.title == "product name" %}

我想知道是否有人有这方面的经验并且知道我可以使用什么请求或价值来使它正确并根据语言修改我的部分。

提前感谢您的帮助!