BigCommerce 访问模板文件中的用户语言代码和货币
BigCommerce access the users language code and currency in the template file
我想知道是否可以获取当前用户的语言代码和货币代码product.html
模板文件。就像使用 {{ }} 封装变量一样。
我当前的product.html
看起来是这样的,但是我想以某种方式访问此页面中当前用户的货币和语言,请帮助。
您可以使用 {{currency_selector.active_currency_code}}
访问货币代码。 https://developer.bigcommerce.com/theme-objects/currency_selector
我认为您无法通过 Handlebars 直接获取语言,但您可以使用一些间接途径查看设置对象中的不同属性。例如,{{settings.country_code}}
。 https://developer.bigcommerce.com/theme-objects/settings
我想知道是否可以获取当前用户的语言代码和货币代码product.html
模板文件。就像使用 {{ }} 封装变量一样。
我当前的product.html
看起来是这样的,但是我想以某种方式访问此页面中当前用户的货币和语言,请帮助。
您可以使用 {{currency_selector.active_currency_code}}
访问货币代码。 https://developer.bigcommerce.com/theme-objects/currency_selector
我认为您无法通过 Handlebars 直接获取语言,但您可以使用一些间接途径查看设置对象中的不同属性。例如,{{settings.country_code}}
。 https://developer.bigcommerce.com/theme-objects/settings