2

I am using below link code but getting following error, the link code is use to update shipping method after coupon code is applied

https://alanstorm.com/refresh-shipping-rates-for-the-magento-2-checkout/

I am getting following error

enter image description here

According, to me it is due to

//address.trigger_reload = new Date().getTime();
1
  • We had same issue with this on 2.2.6 version Cant say for sure why this is happening, but we ended up removing this line address.trigger_reload = new Date().getTime(); For us everything else worked fine without this line that supposed to trick magento into thinking that address has changed. – Macas Oct 16 '19 at 11:53
1

i resolve this error with this code:

requirejs([
                        'Magento_Checkout/js/model/quote',
                        'Magento_Checkout/js/model/shipping-rate-registry'
                 ], function (quote, rateRegistry) {
                        var address = quote.shippingAddress();                          
                        rateRegistry.set(address.getKey(), null);
                        rateRegistry.set(address.getCacheKey(), null);
                        quote.shippingAddress(address);
                        quote.paymentMethod(paymentMethod);
                        address.trigger_reload = new Date().getTime();
                 });

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.