Hello Magento Friends,

Today I have come up with a solution to Get Active Shipping Methods based on Quote ID in Magento 2.

To improve the user experience, you offer various shipping methods in your store. While working with checkout customization, you need a list of active shipping methods. When you want to get active shipping methods for the current quote, you can use the quote ID in Magento 2.

Steps to Get Active Shipping Methods based on Quote ID in Magento 2:

Step 1: Create a helper file Data.php at the below path

app/code/Vendor/Extension/Helper/Data.php

And add the code as follows

Note – From $shippinigData you can also get the Shipping Amount, Shipping Carrier Code, etc.  You can use the getShippingMethod($quoteId) method in your block file or phtml file as per your requirement.

Conclusion:

This way, you can get active shipping methods using quote ID in Magento 2. Share the article with other Magento developers and stay updated for more.

Happy Coding!

Click to rate this post!
[Total: 2 Average: 5]