How to increase Magento Fedex shipping rates for methods other than ground?

714 views Asked by At

We would like to start charging our customers an additional amount for any order that is not for Ground. (i.e. only for Overnight, 2day, International). How can I manage it I have tried event observer with sales_quote_collect_totals_before event but it is not working for me please explan proper solution.

1

There are 1 answers

0
Vaibhav Shahu On BEST ANSWER

To implement this functionality, you have to override Fedex.php from /app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php.

To override Fedex.php.Just place Fedex.php file with same folder structure inside local folder.
/app/code/local/Mage/Usa/Model/Shipping/Carrier/Fedex.php.

To add extra shipping charge, update _prepareRateResponse() function.

inside foreach ....

foreach ($priceArr as $method=>$price){..

Update these code to

if($method != "FEDEX_GROUND")               
     $rate->setPrice($price*$extraPrice);           
else
     $rate->setPrice($price);

Thanks.Hope it helps.