Skip to main content
2 of 2
added 2 characters in body
Brad Bell
  • 67.6k
  • 6
  • 75
  • 145

Applying coupon codes via URL

I was wondering if it was possible to allow a customer to apply a coupon code using a URL or URL params in Commerce 2. I haven’t been able to find any questions on stack exchange or on the web, but the scenario I’m trying to support is:

  • Customer receives an email with a coupon code (includes a coupon code image that links to the storefront)

  • Customer clicks a link which takes them to the store and automatically applies the coupon with a toast confirmation (e.g. store.com?coupon=somecouponcode)

  • Customer adds purchasables to cart and when they go to the cart page, the coupon is already applied to cart lineitems without requiring them to manually input it themselves