Skip to main content
Solved

Dynamic discount code in button

  • August 14, 2024
  • 3 replies
  • 37 views

Forum|alt.badge.img+2

I have created a Shopify dynamic discount code in Klaviyo named DISCOUNT15
I know how to display the discount code in a flow email with: {% coupon_code 'WELCOME15' %} but… how do I apply it to a button that will be shown in an email flow?

Tried this but does not work: https://mysite.com/discount/{% coupon_code 'WELCOME15' %}


Thanks in advance!

Best answer by ArpitBanjara

Hey @rarpia 

https://mysite.com/discount/{% coupon_code 'WELCOME15' %} is used to autofill the discount code during checkout,

If you want to redirect them to a specific page and also autofill the discount code during checkout, you can use - https://mysite.com/discount/{% coupon_code '03_10OFF' %}?redirect=/collections/all

You can read more about this here

I hope this helps

Cheers

Arpit Banjara

View original
Did this topic or the replies in the thread help you find an answer to your question?

3 replies

ArpitBanjara
Principal User I
Forum|alt.badge.img+36
  • Principal User I
  • 371 replies
  • Answer
  • August 14, 2024

Hey @rarpia 

https://mysite.com/discount/{% coupon_code 'WELCOME15' %} is used to autofill the discount code during checkout,

If you want to redirect them to a specific page and also autofill the discount code during checkout, you can use - https://mysite.com/discount/{% coupon_code '03_10OFF' %}?redirect=/collections/all

You can read more about this here

I hope this helps

Cheers

Arpit Banjara


Forum|alt.badge.img+2
  • Author
  • Contributor II
  • 3 replies
  • August 14, 2024

Hi  @ArpitBanjara, that is exactly what I want to do -autofill the discount code during checkout-, but I need to generate the link for DYNAMIC UNIQUE CODES, not for static codes.

This https://mysite.com/discount/{% coupon_code 'WELCOME15' %}  does not work for DYNAMIC UNIQUE CODES.

Please help.
Thank you!


Forum|alt.badge.img+2
  • Author
  • Contributor II
  • 3 replies
  • August 14, 2024

Works! My bad.
Thank you