Display order status as "in progress" not "unfulfilled"

2TDGaming
New Member
1 0 0

Hi, 

how can i change was the customer sees as the order status on their account page.  if orders is unfulfilled or fullfilled i want it to display as "In progress" or "Complete". I'm still learning code, so go easy, But is there an IF command i can add to the code below.

eg. IF customer.orders.fulfillment_status (or order.fulfillment_status) equals "unfulfilled" display as "In Progress"

 

thank you!

 

{% unless settings.breadcrumb_styles == 'none' %}{% include 'breadcrumb' %}{% endunless %}

<div class="container">
  <div class="page-account">
    <div class="row">
      
      <div class="col-lg-3 col-md-4 col-sm-12">
        {% include 'account-detail' %}
      </div>
    
      <div id="col-main" class="col-lg-9 col-md-8 col-sm-12">
        <div id="customer_orders">

          <h2>{{'customer.orders.order_history' | t }}</h2>
          {% if customer.orders.size != 0 %}
          <div class="table-wrapper">
            <table>
              <thead>
                <tr>
                  <th class="order_number">{{'customer.orders.order_number' | t }}</th>
                  <th class="date">{{'customer.orders.date' | t }}</th>
                  <th class="payment_status">{{'customer.orders.payment_status' | t }}</th>
                  <th class="fulfillment_status">{{'customer.orders.fulfillment_status' | t }}</th>
                  <th class="total">{{'customer.orders.total' | t }}</th>
                </tr>
              </thead>
              <tbody>
                {% for order in customer.orders %}
                  <tr class="{% cycle 'odd', 'even' %} {% if order.cancelled %}cancelled_order{% endif %}">
                    <td>{{ order.name | link_to: order.customer_url }}</td>
                    <td><span class="note">{{ order.created_at | date: "%b, %d %Y" }}</span></td>
                    <td><span class="status_{{ order.financial_status }}">{{ order.financial_status }}</span></td>
                    <td><span class="status_{{ order.fulfillment_status }}">{{ order.fulfillment_status }}</span></td>
                    <td><span class="total">{{ order.total_price | money }}</span></td>
                  </tr>
                {% endfor %}
              </tbody>
            </table>
          </div>
          {% else %}
            <div class="alert alert-success">
              <button type="button" class="close" title="{{'customer.general.close' | t }}" data-dismiss="alert">×</button>
              <p>{{'customer.orders.none' | t }}</p>
            </div>
          {% endif %}

        </div>
      </div>

    </div>
  </div>
</div>
0 Likes
JoesIdeas
Shopify Expert
1310 118 341

You can change this highlighted code:

Screen Shot 2020-06-08 at 9.07.18 AM.jpg 

 

To something like this:

{% if order.fulfillment_status == "null" || order.fulfillment_status == "partial" %}In Progress{% else  %}Complete{% endif %}

 

References:
https://shopify.dev/docs/themes/liquid/reference/objects/order#order-fulfillment_status

https://shopify.dev/docs/admin-api/rest/reference/orders/order?api (to see values of fulfillment_status)

Founder of Speed Boostr (Shopify optimization experts, theme customization, custom app development).
Creator of Shopify Analyzer (first performance analysis tool for Shopify sites, free for the Shopify community).
Creator of Order Automator (auto tag orders and customers + auto fulfillment + more automations).
More apps: Theme Scientist (A/B testing), Tip Jar (add a tip button), File Optimizer (optimize CSS, JS, Liquid).
0 Likes