2017-02-23 37 views
2

目前我可以自定義字段全部或全部無。像這樣調用特定的custom_field BigCommerce模板

{{#each product.custom_fields}} {{ id }} : {{ name }} : {{ value }} {{/each}}

但是如果我想通過ID或名稱,如下面的調用只是其中的一個東西。有沒有辦法用模板或其他方式做到這一點?

{{product.custom_fields.id:4.name}}

回答

1

您可以使用現有的{{如果}}幫手來完成這個

{{#if display_name '===' 'material'}} 
    {{#each product.custom_fields}} 
     {{id}} : {{name}} : {{value}} 
    {{/each} 
{{/if}}