design and develop customers/order template by using liquid

Hi, I’ve built a Shopify theme from scratch and am currently working on designing the customer orders page. I’ve placed test orders using the Bogus payment gateway, but when I try to display the orders using Liquid (e.g., customer.orders_count), it always shows 0.

Could you guide me on how to properly work with the Order object in Liquid?

Hi @IoannisM , kindly provide your store URL please and if it is password protected, please share the password as well. Thanks

Hi @IoannisM ,

Did you login customer account when checking object for it?

And try ‘customer.orders.size’. For example code:

{%- if customer.orders.size > 0 -%}
  {%- for order in customer.orders -%}
    {% comment %} show code order here {% endcomment %}
  {%- endfor -%}
{%- endif -%}

Hi, I did the following and It worked.

{%- if customer.orders.size > 0 -%}
 {%- for order in customer.orders -%}
  {{ order.id }}
  {{ order.email }}
  {{ order.name }}
  {{ order.total_price}}
  {% comment %} show code order here {% endcomment %}
 {%- endfor -%}
{%- endif -%}

customer.orders_count still return zero, but it’s okay I am fine with the code above.

Hi @IoannisM ,

You’re welcome and happy to help :blush: