I am directing prospects to my site using a URL like:
https://www.mysite.com/discount/64ME6K.
What object do I need to query in liquid to see if that discount will be applied at checkout? cart.discount_applications seems to be empty.
More detail:
I’d like to display a banner throughout the prospect’s visit letting them know that they’ll receive the discount when they order. So I’m trying to modify announcement-bar.liquid to detect if the discount code is active. As a test, I’ve tried:
{% for discount_application in cart.discount_applications %}
<div><p>{{ discount_application.title }}</p></div>
{% endfor %}
That should show me all discounts that have been applied and are active, but I get no output.
I’ve also tried adding something to the cart, going to the checkout screen, and then returning to the homepage. The discount does appear in the checkout, so it does appear to be applied eventually. But if I cancel the checkout and go back to the homepage, I still don’t get the titles of any discounts that have been applied.
So I guess cart.discount_application isn’t the right object to query for a discount activated from a URL. What is?
Thanks for any help!
Lee