TransWikia.com

Custom shipping cost

Craft CMS Asked by David Saenz on February 2, 2021

One of the shipping companies that my client will use works by distance.
This company offers an api where you tell the pickup address and the shipping address. You also specify what type of package to carry (small or medium).
When I have a complete address, I make the call to the API of this company and it returns the shipping cost to me.

Given the particularity of this shipping company, I would like to be able to specify the price of the shipping cost without depending on any shipping method of the system itself. Is this possible?

thanks in advanced

One Answer

Yes this is definitely possible.

We don't use any of Commerce's in-built shipping stuff - fields or calculation, as it's too limited for our needs (not Commerce's fault - we have very complicated shipping requirements!).

You will want to write yourself a custom module with either a full custom shipping calculator, or an adjuster for shipping.

You'd use an adjuster if you don't need to present any options to the user, and a full shipping calculator if you do. If the latter, as long as you implement the interfaces for Rules and Methods, you can do just about anything you wants and present it to the user any way you want. Can be a little tough to get going, but is very flexible once you've got it working.

Docs for this are here: https://craftcms.com/docs/commerce/3.x/shipping-methods.html

Answered by Jeremy Daalder on February 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP