我尝试在脚本标签中使用 {{customer.orders_count}} 来获取客户下的订单总数。但我每次都会得到“0”作为输出。有人可以帮我解决这个问题吗?
这是我会使用的基本清单。用问题回答问题。有时这是唯一的出路。
尝试
{{ customer.orders.size }}
这适用于您的
<script>
orderCount: "{{ checkout.customer.orders_count }}"