Hello, Magento Folks,
We have already learned Magento 2: Hide Other Shipping Methods if Free Shipping is Available. Today I will explain to you about How To Configure Auto Select Shipping method in your Magento 2 store When more than one shipping methods are available.
In the busy world of technologies, here is an only element called Time which is very expensive. So, the lack of time plays an important role in the checkout process of your store so auto select shipping method is considered to be an essential time-saving option for all your customers. Therefore when you have multiple shipping methods available in your store make sure by default to auto select any one shipping method for better customer experience.
When you have only one shipping method available in your store then definitely by default one shipping method is selected at the checkout page so there is no need of any configuration. But when you have multiple shipping methods available in your store then by default any method is not selected at the checkout page.
So, when you need to configure by default auto select one shipping method then you need to do the following code. You can easily configure and make your customer experience better by following below easy steps.
vendor\magento\module-checkout\view\frontend\web\js\model\checkout-data-resolver.js
Past to
app\design\frontend\Themes\Yourtheme\Magento_Chekout\web\js\model\checkout-data-resolver.js
Search below code:
if (ratesData.length === 1) { //set shipping rate if we have only one available shipping rate selectShippingMethodAction(ratesData[0]); return; }
Replace below code:
if (ratesData.length >= 1) { //set shipping rate if we have only one available shipping rate selectShippingMethodAction(ratesData[0]); return; }
If you have completed the above instruction then you have successfully completed the configuration of auto select any one shipping method option by default in your Magento 2 store if multiple shipping methods are available in your store. Now you can give a better customer experience in your Magento 2 store in which there will be by default selection of shipping method if more than one shipping method is available in your store.
So, that was all for the day! With the help of this rich information, you can successfully achieve the task of auto select shipping method if multiple shipping methods are available in your store. If you face any issues while implementing, then contact our support team. We will be happy to help you.
Lastly, if you found this helpful, then let us know your valuable words in the comments below. Also, don’t forget to share this with your Magento development partners.
Happy Coding?
Hello Magento Friends, In today’s blog, I will explain How to Add Tooltip in Checkout…
MongoDB is a popular NoSQL database that offers flexibility and scalability when handling modern web…
In NodeJS, callbacks empower developers to execute asynchronous operations like reading files, handling requests, and…
Hello Magento Friends, In today’s blog, we will learn How to Show SKU in Order…
The "Buy Now" and "Add to Cart" buttons serve as the primary call-to-action (CTA) elements…
Hello Magento Friends, In Magento 2, the checkout process allows customers to choose multiple shipping…