I want to know if we can pre populate the discount code in the checkout/cart page when customer clicks a button from a page.

Aim is when customer clicks a button from a page it should redirect them to checkout/cart with the product in cart (could grab it from the session) but I want to apply a discount code at same time

Is this possible


I haven't tried this myself but apparently is a feature of m2.


  • Create a price rule with a specific coupon code

  • Use a URL link in the format:


  • Replace example.com and couponcode in the URL with your values

Although item needs to be in cart. Wasn't sure that meets your requirements.

  • Hi @dominic I have read this but not sure would this work or how to even implement – Jack Brooks May 29 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.