After an otherwise successful update to Magento 2.2.9, the discount code functionality has stopped working.

When I try to apply it on the Cart page, nothing happens. When I try it on the Payment Method step of checkout, I receive a "Could not apply coupon code" error.

Does anyone know what could be causing this, or how to investigate?

1 Answer 1


Formkeys were added to the coupon form in 2.2.9 (as well as forgot password form for customers).

In your template Magento_Checkout/templates/cart/coupon.phtml, inside the <form> element you'll need to add:

<?= $block->getBlockHtml('formkey'); ?>
  • Hmm, this was a promising answer, but doesn't seem to have helped.
    – brackfost
    Commented Jul 19, 2019 at 16:15
  • 1
    I think that this solution, in tandem with updating an extension, ultimately fixed my issue. Thank you!
    – brackfost
    Commented Jul 19, 2019 at 17:46
  • 1
    @brackfost That would have been my next suggestion; to check for any third party modules that could be breaking it. We had a normal coupon flow & the formkey was the solution in the end, where we saw the cart page just refreshing. Commented Jul 22, 2019 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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