Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FedEx shipping module improvements #3019

Closed
ghost opened this issue May 14, 2015 · 1 comment
Closed

FedEx shipping module improvements #3019

ghost opened this issue May 14, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented May 14, 2015

There are a few modifications to the FedEx shipping module that I think will improve implementation for store owners.

  1. The help section for Weight Class states Set to kilograms or pounds. FedEx is strict about this and will only allow for kilogram and pound, singular. Some store owners add kgs and lbs units for readability so specifying a more stringent Set to kilogram (kg) or pound (lb). and validating it's one of those units on module update can prevent problems.
  2. While the FedEx module catches for failures and errors, it can't handle faults. Modifying /catalog/model/shipping/fedex.php from:
if ($dom->getElementsByTagName('HighestSeverity')->item(0)->nodeValue == 'FAILURE' || $dom->getElementsByTagName('HighestSeverity')->item(0)->nodeValue == 'ERROR') {
    $error = $dom->getElementsByTagName('HighestSeverity')->item(0)->nodeValue;

    $this->log->write('FEDEX :: ' . $response);
} else ...

to something like:

if ($dom->getElementsByTagName('faultcode')->length > 0) {
    $error = $dom->getElementsByTagName('cause')->item(0)->nodeValue;

    $this->log->write('FEDEX :: ' . $response);
} elseif ($dom->getElementsByTagName('HighestSeverity')->item(0)->nodeValue == 'FAILURE' || $dom->getElementsByTagName('HighestSeverity')->item(0)->nodeValue == 'ERROR') {
    $error = $dom->getElementsByTagName('HighestSeverity')->item(0)->nodeValue;

    $this->log->write('FEDEX :: ' . $response);
} else ...

would allow for faults to be captured and handled.

@danielkerr
Copy link
Member

for some reason can not test. but have added your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant