Custom script on checkout page not working

DMCB
Excursionist
13 0 4

Hi! I have the following script on my checkout page but nothing is showing up. Could anyone help me troubleshoot please?

 

<script>
{% case localization.language.iso_code %}
{% when 'en' %}
<div class="content-box">
<div class="content-box__row"><h2>COMMERCIAL INVOICE AVAILABLE</h2></div>
<div class="content-box__row"><p><a target='_blank' href='https://www.dansmaclasseboutique.com/apps/download-pdf/orders/7f3237ebac5317fa909e/{{ order.id | times: 8002 }}/{{ order.name | handleize }}.pdf'>Download my PDF invoice</a></p></div></div>
{% else %}
<div class="content-box">
<div class="content-box__row"><h2>FACTURE FISCALE DISPONIBLE</h2></div>
<div class="content-box__row"><p><a target='_blank' href='https://www.dansmaclasseboutique.com/apps/download-pdf/orders/7f3237ebac5317fa909e/{{ order.id | times: 8002 }}/{{ order.name | handleize }}.pdf'>Télécharger ma facture fiscale</a></p></div></div>
{% endcase %}
{% endif %}
</script>

 
Reply 1 (1)

yashgarg
Shopify Partner
102 26 32

Hey @DMCB ,

 

The code you entered above is liquid (+ HTML) code, it should not be inside <script> and </script> tags which is for JavaScript code.

 

Thanks

Yash Garg

If this works for you, please give it a like and mark it as the solution! Thanks 🙂
Feel free to contact me for Shopify tech support
Email: yashgarg.tech@gmail.com