skip to Main Content

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?

2

Answers


    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.

    Login or Signup to reply.
  1. try {{ customer.orders.size }}

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search