Fábio Carneiro
Fábio Carneiro

Reputation: 115

Custom Multiple Shipping Carrier Module

I'm writing an API/Webservice module for magento.

I have a freight webservice, that returns me all available carriers and shipping methods based on the products I send as params.

I send

SKU0101
SKU0102

It returns

DHL
DHL OVERNIGHT 20.10
DHL EXPRESS 15.20

FEDEX
FEDEX OVERNIGHT 21.10
FEDEX EXPRESS 15.20

I want to populate that in the available carriers/methods in frontend, so the user can choose the shipping method, but magento (at least i guess), only provides a way to create ONE carrier, with multiple shipping methods, while i need to create MULTIPLE carriers with multiple shipping methods

Of course i could create many carriers in the module and populate them according to what i get from the webservice, but that way i would need to upgrade the module every time a new carrier is added to my webservice system, and also my clients, what will happen very often.

Upvotes: 1

Views: 817

Answers (2)

Ross McDermid
Ross McDermid

Reputation: 1

May be worth speaking to David Craigon at Parcelhub about their multi carrier integration - http://www.parcelhub.co.uk/parcelhub-magento-shipping-software/

Hope this helps, Ross

Upvotes: 0

Fábio Carneiro
Fábio Carneiro

Reputation: 115

Problem solved.

What i did:

Overrode the Shipping and Quote Adress Rate models extending the originals, so i dont need any config for the carriers and vendors that i will get from webservice, but kept the old parent code calling its parent function. Added my custom logic after that.

        <shipping>
            <rewrite>
                <shipping>Vendor_Shipping_Model_Shipping</shipping>
            </rewrite>
        </shipping>
        <sales>
            <rewrite>
                <quote_address_rate>Vendor_Shipping_Model_Quote_Address_Rate</quote_address_rate>
            </rewrite>
        </sales>

Upvotes: 1

Related Questions