Accessing the discount object on the front end to show discount % and update DOM

Hello,

I am working on some code to display the users cookied coupon code which I was able to display successfully.

However I cant seem to parse any details about the discount code as from what I can tell the discount object isn’t loaded, but only on the checkout/cart pages?

Any advice on how to retrieve details or if we can force the discount code information to load in the user’s browser.

Thank you!

1 Like

How did you manage to access the coupon code from the cookie? Is there a Liquid API call I’m not aware of?

I’m looking for a way to highlight and display the code loaded from the URL (e.g. /discount/xxx)