2017-02-23 35 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}}