Solved

Add to cart & Coupon codes that auto apply.

  • 2 March 2021
  • 6 replies
  • 160 views

Badge

Hi All,

 

I have managed to get a coupon code to auto apply in shopify checkout which is perfect. I am trying to do the same on a add to cart flow (Add to Cart Metric not checkout started metric) The problem is I can’t seem to get it to work with the {{ evet.url }}?/discount/Coupon name.

Anyone got any ideas how I can get this to work.

Many thanks

Dave

icon

Best answer by caroline 3 March 2021, 17:05

View original

6 replies

Badge

Hi Caroline,

I have already looked at these and tried every variation possible. What I am trying to is this mysite.com/discount/{% coupon_code 'Basket10' %}&redirect=/{{ event.URL }} of the back of an add to cart triggered flow. To apply the discount and link back to the event.URL back I have tried all of the combinations on that page and somethings not right with what I am doing. Any additional help would be appreciated.

My basket abandonment is working perfectly mysite.com/123456789//checkouts/{{ event.extra.token }}?discount={% coupon_code 'Basket10' %}.

I have tried this in the add to cart triggered flow but that doesn’t seem to work presumably because the checkout point doesn’t appear in the dynamic content.

 

Many Thanks

Dave

Badge

Hi Caroline it is a dynamic code but I would be interested to see what the different syntax would be for both dynamic and static for future reference.

Badge

Hi Caroline unfortunately it didn’t work. It works with Checkout started trigger just not with add to cart trigger. We have decided to go without it auto applying for now.

Dave

Userlevel 5
Badge +4

Hi there,

Our Help Center article, “How to Add Link that Applies a Coupon Code to a Shopify Cart,” outlines the structure of the URL needed to auto-apply the discount.

Best,

Caroline

Userlevel 5
Badge +4

Hi there,

Thanks for sharing those additional details. Can you clarify if the coupon code is static or dynamic? Auto-applying both types should be possible even outside of an Abandoned Cart flow, but whether it is static or dynamic determines the syntax that should be used.

Best,

Caroline

 

Userlevel 5
Badge +4

Hi there,

The syntax for auto-applying dynamic coupons should be:

https://www.mysite.com/STOREFRONT_ID/checkouts/{{ event.extra.token }}?discount={% coupon_code 'NAME_OF_YOUR_COUPON' %}

You might find our Help Center article, “How to Add a Link that Applies a Unique Coupon Code at Checkout,” helpful.

Have you tried following the above syntax?

The syntax for static coupons is outlined here, but I would definitely try the above syntax since your coupon is dynamic.

Hope this helps!

Best,

Caroline

 

Reply