Hello,
I am using Klaviyo with Shopify. However, when I create a dynamic coupon within Klaviyo and add it to a button in the email, the coupon is sometimes not automatically applied at checkout. The coupon is active, and there are no issues with its settings. Sometimes, it redirects to the checkout page and then activates the coupon.
The second code below sometimes redirects to the homepage instead of the checkout page. The first code definitely redirects to the checkout page.
What I want is simple:
When a user clicks the button in the email, they should be redirected to the checkout page and the dynamic coupon should be automatically applied.
I've read a lot of forum posts about this, but unfortunately none of them have worked for me.
I’d really appreciate any help or suggestions you could offer.
Thanks in advance!
note: I am experiencing these issues with the Klaviyo abandoned cart.
{% with event.extra.line_items as items %}
{{ organization.url|trim_slash }}/cart/{% for item in items %}{{ item.variant_id }}:{{ item.quantity|floatformat:'0' }}{% if not forloop.last %},{% endif %}{% endfor %}?checkout%email]={{ email }}&discount={% coupon_code 'UC_7_36h' %}
{% endwith %}
------------------------------------
{{ event.extra.checkout_url }}&discount={% coupon_code 'UC_7_36h' %}