سؤال

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?

هل كانت مفيدة؟

المحلول

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'); ?>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top