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 |
---|---|
76 | |
65 | |
64 | |
53 | |
49 |
We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023