Menu Close
    Hire us 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:

    app/code/Webkul/Customshipping/etc/config.xml


    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.

    app/code/Webkul/Customshipping/Model/Carrier.php


    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:

    app/code/Webkul/Customshipping/etc/adminhtml/system.xml

    . . .

    Comments (5)

    Add Your Comment

  • 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?
  • SHEHAN GOMES
    Thanx
  • Arsalan Ajmal
    Thank you for your post, very helpful. Keep on sharing your great work 🙂
  • Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just received your message and our expert will get back to you shortly.
    Send Again
    Close