🔥 Just Launched! Werra Premium Template for HyväSee it in Action

How to Remove Payment Method From Quote Using Js

By Chandresh ChauhanUpdated on Mar 17, 2025 1 min read

In any e-commerce store, the checkout process should always be flexible.

One common error in your Magento 2 checkout is that the quote has an already selected and saved payment method.

In this simple tutorial, find the JS code to remove this pre-selected and saved payment method and allow your customers to select by themselves.

How to Remove Payment Method From Quote Using Js

Use this code in your function where you need to remove the payment method :

where quote is 'Magento_Checkout/js/model/quote' ,
checkoutData is 'Magento_Checkout/js/checkout-data' and 
getPaymentInformation is 'Magento_Checkout/js/action/get-payment-information' objects


      var deferred = $.Deferred();
          quote.setPaymentMethod(null);
          checkoutData.setSelectedPaymentMethod(null);
          getPaymentInformation(deferred);

And that’s all!

After this, your customers will surely have a seamless checkout experience.

Try out this solution, and if you face any error, drop your comment. I would be happy to help.

Chandresh Chauhan Full Image
Article byChandresh Chauhan

He has been with Meetanshi for more than three years now as a certified Magento developer. A silent guy whom you can always find solving clients' issues, is an avid reader too.