Adding a Popup Message When Discount Code is Applied

metagals
Excursionist
20 1 0

Hello!

Some of our users are confused when entering discount codes because it only reflects the discount within the line items.

I would like to add a popup message or something similar when a discount code is applied that says "discount has been applied to applicable items" or something like that.

I am playing around with the idea of creating an if statement to include in Settings>Checkout>Additional Scripts 

This is what I have so far:

{% for discount_application in checkout.discount_applications %}
{% if discount_application.title %}

<script>
function myFunction() {
  alert("Discount has been applied!");
}
</script>
{% endif %}
{% endfor %}

This is obviously very crude and I need some serious direction. I am just curious if this has come up for anyone else and they could help me formulate the proper statement. 

Thanks!

-Hazel  

0 Likes
hopps
Tourist
43 0 1

Hi there! Here's an answer to your question: https://app.hopps.io/videos/how-do-i-add-a-popup-message-when-the-discount-code-is-applied-178898567.... If it doesn't make sense or you still have questions, one of the experts can walk you through the solution. 

0 Likes