When you are in the invoice form, you do not have access to the Order object.
To get to an order, you would need to find it through invoice_items that is part of an order.
An invoice can be related to an order in 2 ways.
If the invoice is created from an order without shipping it, you would access order by accessing any of the invoice items and then the order_item_invoicings records.
For example
{% assign first_line = Invoice.invoice_items | first %}
{%assign first_invoicing = first_line.order_item_invoicings | first %}
{{ first_invoicing.order_item.order.order_number}}
If the invoice is created from an order by a shipment, you would access order by accessing any of the invoice items and then the order_shipments records.
For example
{% assign first_line = Invoice.invoice_items | first %}
{% assign first_os = first_line.order_shipments | first %}
{{ first_os.order_item.order.order_number}}
Have More Questions?
Submit a Request or Create a New Post
Submit a Request or Create a New Post
Comments and Suggestions
0 comments
Please sign in to leave a comment.
Related articles