customer.orders not returning all orders.

FazilHaneef
New Member
3 0 0

I was able to make some modifications to the script, remove the ul/li part and was able to get the orders in the table as expected. But, I now have like 50 tables repeating themselves. Any suggestions? @Boots 

 

FazilHaneef_0-1615501131607.png

 

0 Likes
Boots
Shopify Partner
22 0 29

Sorry, the code I posted was not a "real world" example.  It was just to show that you could return more than 20 results.  Working it into your template is beyond the scope of this topic, but you only need to loop through the table rows of your table, not the whole table.  Something like this:

{% paginate customer.orders by 250 %}
<table>
	<thead>
		<tr>
			<th>Order #</th>
			<th>Date</th>
			<th>Status</th>
			<th>Total</th>
		</tr>
	</thead>
	<tbody>
	{% for order in customer.orders %}
		<tr>
			<td><a href="{{ order.customer_url }}">{{ order.name }}</a></td>
			<td>{{ order.created_at | date: "%m/%d/%Y" }}</td>
			<td>{{ order.financial_status_label }} / {{ order.fulfillment_status_label }}</td>
			<td>{{ order.total_price | money }}</td>
		</tr>
	{% endfor %}
	</tbody>
</table>
{% endpaginate %}

 

Hopefully that will get you where you need to go. 

0 Likes