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 %}
{% if payment_status != "" %}
Payment Status: {{ payment_status }}
{% else %}
Payment Status: Not available
{% endif %}
This returns ‘Payment Status: Not available’.