We are having the problem that we need a custom shipping carrier.

We have a third party vendor that does all the shipping for us, but also determines the shipping costs.

The shipping costs are based on:

  • weight of a single product
  • shipping destination

So whenever a customer is trying to checkout I need a custom shipping carrier that either calculates the weight of all products in the quote and also transmitting the desired shipping country to a third party vendor.

This call shall return the final amount for the shipping carrier.

Now the question is:

How can I create a new shipping carrier that checks the weight from the quote and the desired shipping country, sends it on request to another web resource and uses the return value as shipping amount?

The third party vendor does not give us his calculation algorithm, so there is no other way then doing a request each time a customer is trying to checkout.

| improve this question | | | | |
  • I would suggest you to take a look at native Magento Dhl and Fedex modules as an example of implementation. BTW, what is your shipping carrier? – Sergii Ivashchenko Mar 16 '17 at 14:52
  • I already checked some tutorials on how to create shipping carriers, but from reading the DHL carrier code I don't really get smarter. The important part is to get current quote's weight, shipping dest and then do a third-party-call and use the return value as shipping amount. Carrier right now is DHL afaik. – Max Mar 16 '17 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.