How can I display only unfulfilled orders in the theme section?

Hi All,
I am trying to edit the theme section in my customer/account so that it only shows orders that aren’t yet fulfilled. I realise there is a status property on the order, however I have found that this doesn’t get updated for quite some time after the order has been fulfilled.
As a result I want to look at the fulfillmentOrders object and then it’s lineItems to see their status.

I have the customer.orders and I don’t know how to connect the fulfillmentOrders to this. I have tried a number of ways to get there but everything has resulted in null and not an object drop.
Can anyone suggest the right syntax/code for this can be found?
If it is not possible, would someone let me know this too, please?

This is my code so far:
{% paginate customer.orders by 49 %}
{% for order in customer.orders %}
{% assign foundstatus = order.financial_status %}
ordername: {{ order.name }}
order: {{ order }}
fulfillment order1: {{ fulfillments }}
fulfillment order2: {{order.fulfillmentOrders }}

fulfillment order3: {{fulfillmentOrders }}

fulfillment order4: {{order.fulfillmentorders }}


Any help will be greatly appreciated.
Cheers,

1 Like

Hi @Paquita

You are calling items that is not part of the array. You can refer to code below instead

{% for order in customer.orders %}
  {{ order.financial_status_label }}
  {{ order.fulfillment_status_label }}
{% endfor %}

Hi @made4Uo ,
Thanks for your reply.
You are correct that I can and do already used that “order.fulfillment_status_label” but I have found that this does not update for quite some time. And it doesn’t tell me when the fulfillmentOrder.status is CLOSED.
There is also a very long story behind this, but"order.fulfillment_status_label" will be UNFULFILLED in this situation and there is no other way of finding out if the order has been CLOSED except to find out if ffulfillmentOrder.status is CLOSED. Hence I need to access this property. Do you have any ideas about how I can get to this with theme liquid objects?
Cheers,

Oh. So sorry, I misunderstood. You are trying to use the fulfillment API. You have to render using an Shopify extension and request access to the Customer in your case