For some reason I am unable to get Fedex rates. I have put in my account ID (a 9 digit number I presume) and when I try to get the estimate I get the following:
This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.
I know this is just an error set in the admin section, but I’d like to know what the real Fedex error is. Where can I find the fedex error so I now why fedex isn’t responding with the rates?
Do you have at least one “Allowed methods” set in the FedEx configuration section??
Yes, I have all allowed methods selected. I’ve also made sure that products have a weight on the. Again.. if there was any sort of debug log file that I can look up that would be perfect. It’s extremely hard debugging when I don’t know what the problem could be.
Debugging lasted 5 minutes after that! I fixed the problem, though it’s more of a hack. I will report this bug in the “report bug” section.
The error reported by Fedex after I added the snippet from Moshe (which was in system.log, not exceptions.log) said the following
Currency code for Intra CA request must be CAD
This meant that either something was wrong with my configuration or with the currency being sent to Fedex. I checked my configuration and everything was working fine. I then checked what I was sending Fedex by adding the following line to the snippet Moshe gave me
Mage::log($request);
This logs the request. When I looked at my log file I can see it was sending USD as the currency code. That’s odd. So I looked at the same Fedex.php file and wouldn’t you know it.. the following is on line 283
$declaredValue->addChild('CurrencyCode', 'USD');
YIKES! “USD” is hardcoded in as the CurrencyCode… it should be pulling it from the DB. So I’ve submitted a bug and for now replaced “USD” with “CAD” and all works now!
I had rates I couldnt quite tally up with rates we would normally get, so I checked the file, as yes it does say USD for the Currency Code ! Interestingly, If change it to my desired one, ie GBP , it does work ! Trying EUR as the code works, and returns very slightly different rates to that given at the dollar rate. I still dont think these differences are of the scale of the differences I was seeing, but even so, you’re right its a bug and needs fixing.
Sorry, when I added GBP it didnt work. I think my post from earlier missed an ‘nt’ after the does !.
In the end, I found the differences between the rates I got back whether using USD, or EUR were pretty much the same, only a very slight difference probably down to exchange rate fluctuations ...
Hey guys, the best thing to do is to follow Moshe’s advice above to have the error message logged in a system.log. Without knowing what the error is it’ll take forever to debug.
@mdumka: The directory for the fedex file is what Moshe wrote (app/code/core/Mage/Usa/Model/Shipping/Fedex.php) ... Please reread his post on how to debug and reread my post right below his. After I learned how to catch shipping error it took me 5 minutes to fix the bug. So know what the actual error says is very important.
Well I will be dammed ... Your fix worked with CAD ... the problem is I was not entering in the postal code. If this is a required field man you cant just spit out the error like that.
Well ... thanks for the help ... I will have to come up with some good error messages.