I need to update checkout summary with shipping price by default when only one shipping method is available on shipping step.
Currently shipping price is updated when I move on to payment step.
If someone can help then it will helpful, thanks in advance.
Best Answer
After some research got the solution to set shipping price to summary on checkout if there is only one shipping method available.
For this, need to extend
"/vendor/magento/module-checkout/view/frontend/web/js/view/summary/shipping.js"
Have to define '
Magento_Checkout/js/model/cart/estimate-service
' and pass dependencyestimateService
into function.Comment out this line
var price = this.totals().shipping_amount;
under functiongetValue: function()
and add following two lines after that.I am adding screen shot of entire file /module-checkout/view/frontend/web/js/view/summary/shipping.js how it looks after extending and editing.