Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi everyone, I'd like to add two new lines called Payment Due Date and Payment Term in my invoice template which generated with Order Printer App. I'd also like to link the Payment Due Date and Payment Term with the information listed in the payment section for the order. May I ask if someone can help me to check the code and provide me a solution? Many thanks in advance!
HTML code
<!-- Invoice Header -->
<div class="columns">
<h1>Invoice</h1>
<div>
<p style="text-align: right; margin: 0;">
<strong>Invoice</strong> {{ order.order_name }}<br />
<strong>Order</strong> {{ order.order_name }}<br />
{% if order.po_number %}PO # {{ order.po_number }}<br />{% endif %}
<strong>Invoice Date:</strong> {{ order.created_at | date: "%B %e, %Y" }}
</p>
</div>
</div>
Screenshot of the Payment Due Date and Term from Shopify order:
Are you storing these two fields as metafields on your orders?
Then you could access them in the Order Printer App Template like so:
<strong>Payment Due Date</strong> {{ order.metafields.your_metafield_namespace.payment_due_date }}
<strong>Payment Term</strong> {{order.metafields.your_metafield_namespace.payment_term }}
The `your_metafield_namespace` is a name that's entirely up to you. I would recommend using your brand's name so that way it's clear these are metafields belonging to your brand, and not to other apps.
Want to see it in action? Check out our demo store.