0

I want to calculate Shipping Rates on button click instead of postal code change. enter image description here

1 Answer 1

0

If you are checking this file :

vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rate-service.js

There is the code :

quote.shippingAddress.subscribe(function () {
        var type = quote.shippingAddress().getType();

        if (processors[type]) {
            processors[type].getRates(quote.shippingAddress());
        } else {
            processors.default.getRates(quote.shippingAddress());
        }
    });

Which getting the shipping rates. So you need to do the custom code on your button click, so it will call one function of js and from that js function you can call this code.

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.