How to set default shipping method in Magento | Magento Source24


How to set default shipping method in Magento


Hello Magento friends today's i'm share with you to How to set default shipping method in Magento 2 

try this bellow code to set default shipping method in Magento 


$quote = $this->getOnepage()->getQuote();  
$country = "FR";
$address = $quote->getShippingAddress();
$address->setCountryId($country)->setCollectShippingRates(true)->collectShippingRates();
$quote->setShippingMethod('freeshipping')->save();




Deepak Kumar Bind

Success is peace of mind, which is a direct result of self-satisfaction in knowing you made the effort to become the best of which you are capable.

Post a Comment

If you liked this post please do not forget to leave a comment. Thanks

Previous Post Next Post