特定客户的Shopifie订单计数

发布于 2025-01-25 11:39:33 字数 119 浏览 2 评论 0原文

我尝试在脚本标签中使用{{customer.orders_count}}的{{customer.orders_count}}以获取Cutomer下达的订单总数。但是我每次都会获得“ 0”作为输出。有人可以帮我解决这个问题吗?

I tried using {{customer.orders_count}} in my script tag to get the total number of orders placed by a cutomer. But I am getting '0' as an output everytime. Can anyone please help me with this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

冷情妓 2025-02-01 11:39:33
  1. 您确定您有登录客户吗?
  2. 您确定客户有订单吗?
  3. 您是否将值渲染为DOM元素?
  4. 您是否要求在脚本图中渲染到该DOM元素的价值?

那是我将使用的基本清单。用问题回答问题。有时唯一要走的方法。

  1. Are you sure you have a logged-in customer?
  2. Are you sure that customer has orders?
  3. Are you rendering the value into a DOM element?
  4. Are you asking for the value you rendered into that DOM element in your ScriptTag?

That is the basic checklist I would use. Answering a question with questions. The only way to go sometimes.

榕城若虚 2025-02-01 11:39:33

尝试{{customer.orders.size}}

try {{ customer.orders.size }}

篱下浅笙歌 2025-02-01 11:39:33

这将在您的< script>中起作用。

orderCount: "{{ checkout.customer.orders_count }}"

this would work in your <script>

orderCount: "{{ checkout.customer.orders_count }}"
风轻花落早 2025-02-01 11:39:33

在使用测试费用时,将“ 0”作为{customer.orders_count}}的{{customer.orders_count}}的输出是典型的。在实时商店中,订单计数准确地反映了实际订单。

看看这个应用程序:
根据客户订单计数,支出和营销订阅过滤内容交付。
https://apps.shopify.com/dynamic-segment-segment-semtions

Getting '0' as the output for {{customer.orders_count}} in a Shopify development store is typical when using test charges. In live stores, the order count accurately reflects real orders.

Take a look at this app:
Filtered content delivery based on customer order count, spending, and marketing subscriptions.
https://apps.shopify.com/dynamic-segment-sections

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文