Customer convenience is the essential aspect of any successful online store. Offering a convenient method of purchasing as well as shipping is part and parcel of improving the customer experience in an online store.
By default, there are 7 different shipping methods in Magento 2. However, if these default methods are not enough for your business, you can create shipping method in Magento 2.
For custom shipping methods, you need to also look out for other behaviour that needs to be smoothly functioning with customization in the same way as with the default feature. This includes accommodating features such as multiple shipping addresses, which may be essential for some customers. Multiple shipping addresses allow customers to easily manage and choose between different shipping destinations for their orders.
For example, the change in shipping price on the address field change when a custom shipping method is selected. Also enhance the user experience by providing real time cost calculation, transparency and essential shipping information by updating checkout summary on selecting shipping method in Magento 2.
The customer has to refresh the page after changing the value of the address field in order to see the updated shipping rate in default Magento 2.
It’s annoying when you have to reload the page to see the effect on shipping rate after changing country, state, and postcode on the checkout page, isn’t it? That’s why I’ve come up with the solution to change shipping price on address field change in Magento 2 custom shipping method.
6 Comments
How to listen the custom field like custom_attributes[latitude], custom_attributes[longitude] ?
Hello Vrajesh,
Regarding your query, where do you want to get that data?
Is it in your carrriar.php file or in JS file?
Thank You
any idea why region_id_input changed. wont trigger the shipping method reload?
Hello,
It depends on the shipping method and on the creation of the file shipping-rates-validation-rules.js
Thank You
Not working. Can please check again with street field change ?
Hello Vipin,
Please add the below line in getRules function at step 3
Thank You