Skip to main content
Contributor II
August 14, 2024
Solved

Dynamic discount code in button

  • August 14, 2024
  • 3 replies
  • 124 views

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!

    This topic has been closed for replies.
    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

    3 replies

    ArpitBanjara
    Principal User II
    Principal User II
    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

    Arpit Banjara - Lead Email Marketing Specialist at Flowium
    rarpiaAuthor
    Contributor II
    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!

    rarpiaAuthor
    Contributor II
    August 14, 2024

    Works! My bad.
    Thank you