Reputation: 533
I want to calculate shipping rate using UPS api in magento.
I will pass lenght, width, height and zipcode the UPS api will return shipping rate for that product.
I got the UPS rating API that will calculate the shipping rate from the below url after you login.
https://www.ups.com/upsdeveloperkit/downloadresource?loc=en_US
The development guide shows we can implement this using xml or SOAP call.
Can anyone tell me how exactly can I implement this in magento if possible explain it at coding level.
Upvotes: 0
Views: 3192
Reputation: 5670
You dont need to code your own api access. Just use the ootb UPS core extension.
Mage_Usa_Model_Shipping_Carrier_Ups
<Package> <PackagingType><Code>{$params['48_container']}</Code></PackagingType> <PackageWeight> <UnitOfMeasurement><Code>{$r->getUnitMeasure()}</Code></UnitOfMeasurement> <Weight>{$params['23_weight']}</Weight> </PackageWeight> </Package>
to
<Package> <PackagingType><Code>{$params['48_container']}</Code></PackagingType> <Dimensions> <UnitOfMeasurement> <Code>CM</Code> </UnitOfMeasurement> <Length>30</Length> <Width>30</Width> <Height>30</Height> </Dimensions> <PackageWeight> <UnitOfMeasurement><Code>{$r->getUnitMeasure()}</Code></UnitOfMeasurement> <Weight>{$params['23_weight']}</Weight> </PackageWeight> </Package>
Just use some variables to change 30 to whatever you want. It works, i tried it!
Good luck!
Upvotes: 0