{% paginate customer.orders by 20 %} is not working

Short description of issue

{% paginate customer.orders by 20 %} is not working

Reproduction steps

In the customer account page, I have a total of 30 orders. If I show 20 orders per page, then it will not show another page. Another problem is {{ customer.orders.size }} here customer.orders.size shows 20, but i mentioned I have a total of 30 ordersNote: This is a development store, and all orders are placed for testing purposes

Additional info

{% paginate customer.orders by 20 %} is not working

What type of topic is this

Troubleshooting

1 Like

If I remember correctly (going back a few years here), test orders in a dev store didn’t always show up for me. Can you try testing this on a production store that has real orders?

Hey there,

Thanks for reaching out about paginating customer orders :slight_smile:

Due to the way customers.orders work, {{ customers.orders.size }} is expected to only return a maximum of 20 unless retrieved within a paginate tag, in which case it will return up to the pagination limit.

For example, if your customer has 32 orders:

{{ customer.orders.size }} ==> value: 20
{% paginate customer.orders by 30 %}
{{ customer.orders.size }}==> value: 30
{% endpaginate %}

Regarding whether another page displays or not depends on your theme code. A great way to confirm expected behavior for Legacy customer account pages is to install the Dawn theme, and see what happens with Dawn.

You can also try the following simple setup to narrow down the issue:

{% paginate customer.orders by 20 %}
  {%- for order in customer.orders -%}
    {{ order.name }}
   {%- endfor -%}

  {{ paginate | default_pagination }}
{% endpaginate %}

Happy to help further if you’d like to share your theme code that you’re testing. Otherwise feel free to contact Support and we can look into the theme directly :slight_smile:

Hi @JOY_MATUBBER, were you able to resolve the issue or require further assistance with making the pages work?