I am using Magento 2 version 2.1.8
In checkout step, we have the Flat Rate shipping method enabled & we added a simple product to cart.
We can see the Flat Rate method returned via AJAX but the method is not displayed in frontend. It is still "Sorry, no quotes are available…"
How can I debug the issue on Magento 2?
Where is the code check the shipping methods to show ?
Best Answer
I finally figured out the issue.
The code to check the shipping method to show is in the template file vendor/magento/module-checkout/view/frontend/web/template/shipping.html
Focus on the line
It checks whether or not we have any available rate. If we have any, it shows the shipping method with rates. If not then show No quotes block.
The available rates is getting from the view vendor/magento/module-checkout/view/frontend/web/js/view/shipping.js
The logic Magento 2 to set shipping rates is beyond this single post, but you can check more details in
Focus on lines related to
For my case, there was an extension that overrides the shipping view of default Magento
And in the code of that extension, it checks one more condition to show only shipping methods it allows, so the default Flat Rate returned but it is not in the allowed shipping method, then nothing showed!
So post here for anybody has the same issue can have a light if face with a similar issue!