我正在尝试获取 name: 和 value: 的值,具体取决于用户的国家代码。所以示例用户位置是“DE”,它应该输出:
TRS_TITLE_DE
哈利波特密室 I 硬背壳兼容 Apple iPhone 12
这是数组:
{
"id":3,
"name":"TRS_TITLE_DE",
"value":"Harry Potter Chamber Of Secrets I Hard Back Case Compatible With Apple iPhone 12"
},
{
"id":4,
"name":"TRS_TITLE_FR",
"value":"Harry Potter Chamber Of Secrets I Hard Back Case Compatible With Apple iPhone 12"
},
{
"id":5,
"name":"TRS_TITLE_IT",
"value":"Harry Potter Chamber Of Secrets I Hard Back Case Compatible With Apple iPhone 12"
},
{
"id":6,
"name":"TRS_TITLE_US",
"value":"Harry Potter Chamber Of Secrets I Hard Back Case Compatible With Apple iPhone 12"
},
这是我尝试过的:
{{#if settings.country_code "==" "DE"}}
<h1>
{{itemAt product.custom_fields 2}}
</h1>
{{else}}
<h1>It's not there</h1>
{{/if}}