I am trying to extract the code value from shipping_lines for something I want to do on our invoice template in Order Printer.
I understand that the shipping_lines key is an array. Order Printer suggests that shipping_lines can be used and I can see it in the order’s JSON, but I can’t get it to return anything. We’ll only ever have a single object in this array due to our shipping setup. I was thinking that I’d be able to use shipping_lines[0].code but it doesn’t return anything. What am I doing wrong?
Thanks in advance.
Hi,
You can refer to the code provided below:
{% for shipping_line in shipping_lines %}
...
{% endfor %}
For more information on shipping that can be used, you can refer to the content below.
If you encounter difficulties, we recommend that you contact the developer of the order printing app to help you out.
Shipping line details
Shipping lines
{% for shipping_line in shipping_lines %}
...
{% endfor %}
Title
{{ shipping_line.title }}
Price
{{ shipping_line.price | money }}
Shipping address
{{ shipping_address | format_address }}
Shipping methods (collection of shipping lines)
{{ shipping_methods }} or {{ shipping_lines }}
Shipping method
{{ shipping_method.title }} or {{ shipping_line.title }}
Shipping price
{{ shipping_price | money }}
First name
{{ shipping_address.first_name }}
Last name
{{ shipping_address.last_name }}
Name
{{ shipping_address.name }}
Company
{{ shipping_address.company }}
Address 1
{{ shipping_address.address1 }}
Address 2
{{ shipping_address.address2 }}
Street
{{ shipping_address.street }}
City
{{ shipping_address.city }}
Province
{{ shipping_address.province }}
Province code
{{ shipping_address.province_code }}
Postal code / ZIP code
{{ shipping_address.zip }}
Country
{{ shipping_address.country }}
Country code
{{ shipping_address.country_code }}
Phone number
{{ shipping_address.phone }}
Thanks @Leo307666 . I have tried this on my invoice template:
{% for shipping_line in shipping_lines %}
{{ shipping_line.code }}
{% endfor %}
But it returns nothing. 
Hi,
As far as we know, “shipping_line.code” is not yet available for order printing
1 Like
@Leo307666 That would explain it, thank you!