0
  1. Add product to cart

  2. Apply for a Gift card in the Gift Card section on shopping cart page

  3. Then remove the Gift card from Shopping cart summary section

Please let us know if anyone faced this issue before and its solution if anyone knows.

Thanks

1 Answer 1

0

I have found one solution and it seems there is a bug in default Magento. I have created a patch for this issue where we can fix it easily by applying the patch. Create new file named as GIFT-CARD-REMOVE-404.patch and past below code in it.

diff --git a/vendor/magento/module-gift-card-account/Controller/Cart/Remove.php b/vendor/magento/module-gift-card-account/Controller/Cart/Remove.php
index 9988befb..ad4921fa 100755
--- a/vendor/magento/module-gift-card-account/Controller/Cart/Remove.php
+++ b/vendor/magento/module-gift-card-account/Controller/Cart/Remove.php
@@ -7,14 +7,14 @@
 namespace Magento\GiftCardAccount\Controller\Cart;

 use Magento\Checkout\Model\Cart as CustomerCart;
-use Magento\Framework\App\Action\HttpPostActionInterface;
+use Magento\Framework\App\Action\HttpGetActionInterface;
 use Magento\Framework\App\ObjectManager;
 use Magento\GiftCardAccount\Api\GiftCardAccountManagementInterface;

 /**
  * @inheritDoc
  */
-class Remove extends \Magento\Checkout\Controller\Cart implements HttpPostActionInterface
+class Remove extends \Magento\Checkout\Controller\Cart implements HttpGetActionInterface
 {
     /**
      * @var GiftCardAccountManagementInterface

You can run this patch via below command

patch -p1 < GIFT-CARD-REMOVE-404.patch

Flush cache and verify. Hope this will help you.

Your Answer

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

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