How to Add Custom Shipping Method Under Shipment Tracking Dropdown in Magento 2
Shipping in E-commerce is something that merchants usually don’t pay enough attention to but is critical for customers’ experience. The admin’s task is not over when the order is placed and payment is received but optimizing the shipping methods is also required.
Hence, the default Magento 2 supports these shipping carriers:
- DHL
- Federal Express
- United Parcel Service
- United States Postal Service
However, these carrier options may not be enough for modern business requirements.
That’s why, when you want to integrate with 3rd party logistics, you need to create a new shipping carrier.
In order to create a new shipping carrier or add custom shipping method under shipment tracking dropdown in Magento 2, you first need to create a custom shipping method in Magento 2. You can also add tracking number to current order shipment which will help customers to track their orders.
Related Articles:
- How to Create Custom Carrier Trackers in Magento 2
- How to Configure Magento 2 Custom Order Number Extension
- How to Change Shipping Price on Address Field Change in Magento 2 Custom Shipping Method
Check out the below solution for the same:
Method to Add Custom Shipping Method Under Shipment Tracking Dropdown in Magento 2
First, create custom shipping method in Magento 2 store.
After creating your custom shipping method, add the below function in the model carrier file.
1 2 3 4 |
public function isTrackingAvailable() { return true; } |
The output will look like below:
That’s all!
If you have any doubts regarding this post, just mention them in the Comments section below.
I would be happy to help.
Feel free to share the solution with Magento Community via social media.
Thank You.
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
How to Make a Partial Refund in Magento 2
How to Get Product Salable Quantity in Magento 2
Next