0

我正在尝试在模板中的 product-view.html 模板中获取客户的愿望清单,但它不起作用,我得到的是 {{customer.name}} 但不是 {{customer.wishlist}}

{{# if customer.wishlists.length '>' 1 }} {{lang 'account.wishlists.add_item'}}
{{#each customer.wishlists}} {{name}} {{/each}} {{else }} {{/如果}}

如果有人有解决方案,请告诉我。

4

1 回答 1

1

我得到了解决方案在pages>>product.html中 添加以下内容,然后 n 将能够获取愿望清单的数据。


客户:
   愿望清单:
     限制:10


当您创建需要访问特定属性(例如特色产品或客户信息)的商店页面时,您必须首先通过在页面模板文件顶部包含一个前端块来声明这些属性

然后可以在该页面的上下文中访问该属性:您将能够通过在 HTML 代码中的属性名称周围包含 Handlebars 双括号来访问该属性的值。

于 2016-12-27T05:57:50.457 回答