Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
I am using a third party service for invoice generation. It generates a URL where Users can download the invoice. The URL is saved as a Liquid Variable: {{metafields.invoice.url}}
I am trying to add a content box to the order status page that allows the user to download the invoice from there.
What do I have to do in order to be able to include the liquid variable as the URL into a HTML link? See my poor, non-working effort below. I pasted that snippet to the "additional scripts" section in the checkout preferences. The box is displayed but the URL not included.
<script> Shopify.Checkout.OrderStatus.addContentBox( '<h2>Invoice</h2>', '<p>You can download your invoice<a href="{{metafields.invoice.url}}">here.</a></p>' ) </script>
Solved! Go to the solution
This is an accepted solution.
Assuming metafields should be part of the order, you might want to try this instead:
<script> Shopify.Checkout.OrderStatus.addContentBox( '<h2>Invoice</h2>', '<p>You can download your invoice<a href="{{order.metafields.invoice.url}}">here.</a></p>' ) </script>
This is an accepted solution.
Assuming metafields should be part of the order, you might want to try this instead:
<script> Shopify.Checkout.OrderStatus.addContentBox( '<h2>Invoice</h2>', '<p>You can download your invoice<a href="{{order.metafields.invoice.url}}">here.</a></p>' ) </script>
Curious- What's the 3rd party invoice service you mentioned?
User | RANK |
---|---|
205 | |
109 | |
86 | |
57 | |
45 |