Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vineeth 71 posts 291 karma points
    May 24, 2019 @ 12:15
    Vineeth
    0

    Calculate custom shipping rate from an shipping API

    How can we assign Shipping rate from an external shipping API to tea commerce shipping method? With or without using customShippingCalculator?

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    May 27, 2019 @ 14:32
    Matt Brailsford
    100

    Hi Vineeth,

    You'd want to use a custom ShippingRateCalculator for this. You can find some info on the docs site here https://docs.teacommerce.net/3.3.0/api/extending-tea-commerce/#shipping-calculator

    Ultimately, you'd setup a shipping method, but probably set it's value to 0, then using a custom shipping rate calculator, when the order total is calculated, check to see if they are using your shipping method and if they are, request an actual value from your API and return that from the CalculatePrice method.

    Hope this helps

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft