All things Shopify and commerce
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'.
Solved! Go to the solution
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:
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.
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.
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:
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.
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.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025