Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    create custom shipping method in magento2

    To create custom shipping method in magento 2 , you first need to define it in your config.xml file, which is located at:


    In this file we define shipping method code, which should be unique for each method.

    Now, we need to define our model, which is already defined in config.xml under the <model> tag.

    In model we calculate our shipping cost.


    After that your shipping method will get displayed on frontend.

    To define custom setting of shipping method, you need to create system.xml , which is at location:


    . . .

    Comments (6)

    Add Your Comment

  • Ghulam Muhammad
    Really helpful material This is what I was looking 🙂 .
  • cole hafner
    This is great. Thank you! However, I’m trouble understanding how to get the data in the current cart/order, so I can pass it to my external shipping API. I expect I’m supposed to make the request in collectRates() function. Does the RateRequest param include information such as destination address, cart items, and weight? If no, where can I get that information? Any help would be much appreciated.
    • Piyush Dangre
      I have the same question ! Pls any help wud be appreciated ! 🙂
    • Piyush Dangre
      @cole_hafner:disqus Did you figure out how to do that, mate?
  • Arsalan Ajmal
    Thank you for your post, very helpful. Keep on sharing your great work 🙂
  • Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again