I plan on using a 3PL API for all my shipping need...
# general
t
I plan on using a 3PL API for all my shipping needs outside a certain radius, and within that radius I plan on using rates from a local carrier that is near me (I determine those rates). I am assuming I will have go outside the scope of the normal shipping functionality for this. The only need thing I need from Solidus is the User's address and Product info (dims/weight). I am assuming it's as easy as calling the correct shipping rate from the API, adding it to product price and sending it over to the payment processor. How's my thinking on this?
c
Solidus provides a way for you to write your own shipping calculator where you can get all the details for the items in the order and return the corresponding cost. I would encourage you to take a look at the docs here https://guides.solidus.io/developers/shipments/custom-shipping-calculators.html. There are also some examples of API integrations from shipping calculators in https://github.com/solidusio-contrib/solidus_easypost. That may give you some ideas on how you could go about implementing this.
πŸ™Œ 1
t
Thanks a ton. We will be shipping nothing other than pallets, and the business literally has "delivered" in the name, so stakes are high πŸ˜„. I appreciate the detailed response.
c
No problem, feel free to post in #C0JBKDF35 if you have any questions around implementing this custom calculator. Shipping calculators are a pretty standard way to extend Solidus so I hope you don’t run into any issues.
Now that I am looking at the extension I linked, it looks like the rate fetching logic is actually implemented in a custom
Stock::Estimator
class, but the idea is similar https://github.com/solidusio-contrib/solidus_easypost/blob/master/lib/solidus_easypost/estimator.rb
πŸ‘ 1
t
Thanks for doing some digging! I'll be sure to check it out when it comes time to implement.
πŸ‘πŸΌ 1
m
We build a custom thing using https://github.com/friendlycart/physical and https://github.com/friendlycart/friendly_shipping for similar needs at CandleScience. Essentially we have a custom Estimator class that converts the Spree:Stock:Package instances into physical boxes/pallets and then send those via FriendlyShipping to the API.
t
Perfect! Thanks a lot the suggestions.