customers/orders
customers/orders
模板渲染了客户订单列表页面,该页面显示了客户所有的历史订单列表。
位置
customers/orders
模板位于主题的 templates/customers
目录中:
└── theme
├── layout
├── templates
| └── customers
| ├── orders.json
| ...
...
内容
你可以将 customer 对象包含在 customers/orders
模版中或模版内的某个 section 中。
customer object
你可以访问 Handlebars customer 对象以显示订单列表。
用法
在使用 customers/orders
模板时,你应该熟悉以下内容:
提示
如果你使用的是 JSON templates,那么任何 HTML 或 Handlebars 代码都需要包含在模板引用的 section 中。
显示客户的订单列表
为了向客户展示他们的订单列表,你可以通过 customer 对象的 order
属性来访问这些订单。由于每页的订单数量限制为 10 个,你应该对订单进行分页,以确保所有订单都能被访问:
<!-- order info -->
这篇文章对你有帮助吗?