2

I need to unset the shipping method if it was selected by the customer based on some condition. I tried

$('#shipping_method').prop('checked', false);

unchecking the radio button of that particular shipping method but the shipping method is set and shipping charges is applied to the cart.

How to unset the shipping method?

0

I have found it myself. We can unset the shipping method like below:

require([
    'Magento_Checkout/js/action/select-shipping-method'    
   ],
    function(
        selectShippingMethodAction
    ) {
        selectShippingMethodAction(null)  //pass on the shippingmethod
    });

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.