How to return payment status value in packing slip

Solved

How to return payment status value in packing slip

dantis
Visitor
2 1 0

I want to mention 'COD order' or 'Prepaid Order' according to the payment method in my store's packing slip. For that I've tried customising the packing slip template with the variables {{order.gateway}}, {{transaction.gateway}}, {{order.financial_status}} & {{transaction.status}}. 

 

None of the variables worked and I tried to see if it's even returning any values, and found that all these variables are returning empty values. I checked with actual orders, and still no values returned.

 

Does anyone know any solution for this?

 

Latest code i've tried is: 

 

{% assign payment_status = "" %}
{% for transaction in order.transactions %}
  {% if transaction.kind == "sale" %}
    {% assign payment_status = transaction.status %}
  {% endif %}
{% endfor %}

<p>
  {% if payment_status != "" %}
    Payment Status: {{ payment_status }}
  {% else %}
    Payment Status: Not available
  {% endif %}
</p>

 

This returns 'Payment Status: Not available'. 

Accepted Solution (1)

dantis
Visitor
2 1 0

This is an accepted solution.

After interacting with some Shopify experts, I've realized that Shopify currently does not allow the use of payment-related variables in the packing slip template.

However, I found a few solutions:

  1. Add Notes to Orders: Add a standardized note (e.g., COD) to COD orders, and then use the {{ order.note == "COD" }} condition (if-else condition) to return the desired output.

    But this solution requires manual input of order notes. So, if you want to fully automate this process, consider the next solution.

  2. Install the 'Shopify Flow' App: Create a workflow that checks the payment gateway and adds a 'COD' tag to COD orders. Then use {% if order.tags contains 'COD' %} and {% else %} conditions to generate the desired output.

Hope this helps.

View solution in original post

Reply 1 (1)

dantis
Visitor
2 1 0

This is an accepted solution.

After interacting with some Shopify experts, I've realized that Shopify currently does not allow the use of payment-related variables in the packing slip template.

However, I found a few solutions:

  1. Add Notes to Orders: Add a standardized note (e.g., COD) to COD orders, and then use the {{ order.note == "COD" }} condition (if-else condition) to return the desired output.

    But this solution requires manual input of order notes. So, if you want to fully automate this process, consider the next solution.

  2. Install the 'Shopify Flow' App: Create a workflow that checks the payment gateway and adds a 'COD' tag to COD orders. Then use {% if order.tags contains 'COD' %} and {% else %} conditions to generate the desired output.

Hope this helps.