Shopify themes, liquid, logos, and UX
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>
Works like a charm! Many thanks
Curious- What's the 3rd party invoice service you mentioned?
User | RANK |
---|---|
62 | |
52 | |
46 | |
39 | |
37 |
Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023With 2-Factor Authentication being required to use Shopify Payments, we’re here to help yo...
By Imogen Apr 26, 2023