FedEx - Web Services v9
#161
Posted 13 December 2011, 12:21
Includes all changes from V9.2
Added:
My attempt at installation instructions. (they are crude but I tried)
A Changelog (to try and keep track of changes)
Stopped the module from quoting a ground rate to a foriegn country (international ground, if enabled, is unaffected).
Stopped the module from quoting rates for a PO Box shipping address.
The only changes are to /includes/modules/shipping/fedexwebservices.php
at or about line 88
if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_INTERNATIONAL_GROUND == 'true') {
Changed to:
if ((MODULE_SHIPPING_FEDEX_WEB_SERVICES_GROUND == 'true') && ($order->delivery['country']['iso_code_2'] == $this->country)) {
at or about line 287
$this->quotes = array('module' => $this->title,
'error' => $message);
}
changed to:
$this->quotes = array('module' => $this->title,
'error' => $message);
}
// po box hack by JD
if (eregi("^P(.+)O(.+)BOX",$order->delivery['street_address']) ||eregi("^PO BOX",$order->delivery['street_address']) || eregi("^P(.+)O(.+)BOX",$order->delivery['suburb']) || eregi("^[A-Z]PO",$order->delivery['street_address']) || eregi("^[A-Z]PO",$order->delivery['suburb'])) {
$this->quotes = array('module' => $this->title,
'error' => '<font size=+2 color=red><b>Federal Express cannot ship to Post Office Boxes.<b></font><br>Use the Change Address button above to use a FedEx accepted street address.'); }
// end po box hack by JD
Hope this helps someone else besides me.
#162
Posted 13 December 2011, 20:56
#163
Posted 13 December 2011, 21:59
Fatal error: Cannot redeclare cmp() (previously declared in /includes/modules/shipping/fedexwebservices.php:225) in /includes/modules/shipping/fedexwebservices.php on line 225
I found a different contrib that works really well here: http://addons.oscommerce.com/info/1462
#164
Posted 14 December 2011, 10:29
If you are, run a search on the paypal module for function cmp()
I have to wonder now if that was not used in that module. If so, that is the problem, two different modules using the same function call for two different functions.
Just my guess at the moment, as I do not know what modules you have installed.
As for useing FedEx Real Time Quotes. That will only work for a short time, FedEx will be phasing out all of the old API support next year.
#165
Posted 14 December 2011, 17:36
jdfitch, on 14 December 2011, 10:29, said:
If you are, run a search on the paypal module for function cmp()
I have to wonder now if that was not used in that module. If so, that is the problem, two different modules using the same function call for two different functions.
Just my guess at the moment, as I do not know what modules you have installed.
As for useing FedEx Real Time Quotes. That will only work for a short time, FedEx will be phasing out all of the old API support next year.
Yes I am running Paypal Express also. I have not seen anything regarding this error when searching. I tried to rename the function to something other than cmp(), but it just gives me the same error with the new name I created.
Thanks for the heads up regarding the Real Time Quotes. That one actually stopped working for me b/c I moved the project to the production server and now I'm getting a different error. I'll try this contrib on the new server and see if I get the same function error.
ho humm... [img]http://forums.oscommerce.com//public/style_emoticons/default/sad.png[/img]
#166
Posted 14 December 2011, 17:43
Go figure!
Thanks for being willing to help.
#167
Posted 14 December 2011, 23:51
I have installed the module on several carts, it works very, very well. Thank you for the fine contribution.
We had an error problem with Canadian ground shipping from the USA.
I had a chance this evening to chat with the WebEx services technician. He was able to explain exactly the problem with Ground to Canada. This is the ONLY service affected in this manner. Any other FedEx service to Canada from the USA and any method of shipment to any other country form the USA is NOT affected.
Ground services to Canada need to have the declaration value of the shipment passed to FedEx as this service automatically adds in brokerage fees unless the seller specifies a broker when printing the shipping label. Currently, a "$0.00" value is passed. I need to know how to:
1. Determine the country as Canada,
2. Determine the method as International Ground,
3. Determine the "declared value" of the shipment
4. By-pass the declared value if the seller specifies a Broker is to be used
then send the above information to FedEx to get the actual charges for shipping via International Ground to Canada.
George
Edited by Geotex, 14 December 2011, 23:57.
(George)
#168
Posted 15 December 2011, 19:10
When using the latest published module AND having FedEx rates set to List, I get a $0.00 rate for international shipping. When the rates are set to Account, shipping charges are shown.
??
George
(George)
#169
Posted 17 December 2011, 18:42
(George)
#170
Posted 19 December 2011, 20:32
http://addons.oscommerce.com/info/7977
But does not have any effect on any other FedEx service quote, you still get international econ and priority to Canada rates.
(it is easier and less hassle to use FedEx Express to cross a border anyway- Just MHO and my experience)
There has always been an issue with FedEx returning $0.00 shipping cost for international when LIST rates are applied.
Not sure why but that problem goes back way before this module.
#171
Posted 13 January 2012, 22:22
Druid6900, on 21 June 2011, 22:30, said:
Received this e-mail today, which surprised the hell out of me;
Still 1 to 2 months away from PHP SOAP on the EIG servers, HOWEVER, I am working with some of their technical staff to get this module implemented correctly on servers with PEAR SOAP, for now.
When they mod and test the code (I'm not a coder) and I test it on my site (no PHP SOAP) and see if it works or not, I will not only let you know, I will bring the modded code back here for others that are have the same problem as I (and others) are.
There is a good chance that Mr. Lopez will give this effort his blessing and we'll have it sooner rather than later.
Just an update that EIG is no closer to resolving this than they were back in the summer of 2011. Here's a quote from someone I've been working with from an EIG-related ISP:
"Hi Rob,
I want to give you a quick update as to where we stand with this:
I was able to determine that while we have the PEAR SOAP module installed on our system, we do not have PHP SOAP installed. As a result, we will have to recompile PHP with SOAP support to rectify this situation for you. As I'm sure you can imagine, recompiling PHP for our entire customer base is not something that can be taken lightly. While I am confident we will find the best way to go about this, I can't really say for sure when we will execute that plan. My hope is that it will be completed before May of this year, when FedEx plans to make their changes, but I really can't say for sure right now.
If I hear anything else about this project, I will be sure to update you. Until then, please let me know if there is anything else we can assist you with.
Thank you,
Dan Gorman
Technical Support Manager
FatCow Web Hosting"
It's hard to imagine that other OSC-based sites aren't screaming about this. Is everyone waiting until the last minute? One or two of us can't make this happen, as EIG doesn't seem to appreciate the potential impact. For my own interests, I'll have to leave my present provider and am not waiting until May 2012.
I'm curious what others are experiencing. Am I completely missing something?
#172
Posted 30 January 2012, 03:01
I have recently installed this module on the osCommerce site I'm working on for a client. Everything seems to work great since I am getting rates to display.
However, my client has mentioned a FedEx shipping option called "SmartPost" in which case FedEx drops the package at a local USPS office and then USPS delivers it from there. It is cheaper than the Ground Home Delivery, but the rates for this cheaper SmartPost option are not returned with this Web Services module.
Is anyone else experiencing this?
I tried looking online for a "FedEx SmartPost" osCommerce contribution that could maybe run alongside Web Services, but I didn't find anything.
Hopefully someone else out there can shed some light on how to display FedEx SmartPost rates...
Thanks!!!
#173
Posted 08 February 2012, 18:43
I've tried to modify the module to support the Ship-Separate capability, and have not been succesful yet. If anyones up to the challenge I'm willing to contribute $.
This module is excellent but just lacking a few features to make it perfect. Would any of you code experts have time to attach this now?
This post lists several several features that could help, some which have already been addressed, but the Ship-Seperate designation is critical.
Time is running out
#174
Posted 10 February 2012, 21:29
I'm getting a 500 Internal Server error when testing on my production server running PHP 5.2.17. I've run the SOAP test and it works fine. Soap is listed as 'enabled' for "Soap Client" and "Soap Server" with my phpinfo.php script.
I'm not sure where to troubleshoot. Any ideas welcome.
#175
Posted 21 February 2012, 03:17
Any suggestions?
PS I checked the placement it is in the right areas
#176
Posted 22 February 2012, 02:13
"Could not find a FedEx account number. Is FedEx RealTime Quotes installed and configured?"
Of course, I had to turn off the old FedEx for this new module.
Has anyone fixed this problem? Please let me know what you did to correct.
Sticky Pod
www.stickypod.com
#177
Posted 06 March 2012, 21:17
#178
Posted 06 March 2012, 21:33
Edited by chrismark182, 06 March 2012, 21:34.
#179
Posted 06 March 2012, 22:23
Loi Han, on 20 July 2011, 21:46, said:
[code] $rateReply = $response -> RateReplyDetails;
echo '<table border="1">';
echo '<tr><td>Service Type</td><td>Amount</td><td>Delivery Date</td></tr><tr>';
$serviceType = '<td>'.$rateReply -> ServiceType . '</td>';
$amount = '<td>$' . number_format($rateReply->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount,2,".",",") . '</td>';
if(array_key_exists('DeliveryTimestamp',$rateReply)){
$deliveryDate= '<td>' . $rateReply->DeliveryTimestamp . '</td>';
}else if(array_key_exists('TransitTime',$rateReply)){
$deliveryDate= '<td>' . $rateReply->TransitTime . '</td>';
}else {
$deliveryDate='';
}
echo $serviceType . $amount. $deliveryDate;
echo '</tr>';
echo '</table>';
printSuccess($client, $response);
}
else
{
printError($client, $response);
}
writeToLog($client); // Write to log file
Thanks
I used this code and I have the shipping wieight and Transit Times working with the new fedexwebsiervices.php file.
Here are the changes that I made:
around line: 204
change it to looks like this:
case (0):
// Show weight and Qty Start
$show_box_weight = ' <br>(Total Items: ' . $shipping_num_boxes . ' pcs. Total Weight: ' . number_format($shipping_weight,2) . ' lbs)<br>';
// Show weight and Qty End
break;
around line: 244
change it to look like this:
$cost = (float)round(preg_replace('/[^0-9.]/', '', $cost), 2);
//Begin Transit Time or Deliver Time from Fedex
if(array_key_exists('DeliveryTimestamp',$rateReply)){
$deliveryDate = $rateReply->DeliveryTimestamp;
}else if(array_key_exists('TransitTime',$rateReply)){
$deliveryDate= $rateReply->TransitTime;
}else {
$deliveryDate='';
}
//End Transit Time or Deliver Time from Fedex
}
}
}
else
and then again around line 260
change to the following:
$cost = (float)round(preg_replace('/[^0-9.]/', '', $cost), 2);
//Begin Transit Time or Deliver Time from Fedex
if(array_key_exists('DeliveryTimestamp',$rateReply)){
$deliveryDate = $rateReply->DeliveryTimestamp;
}else if(array_key_exists('TransitTime',$rateReply)){
$deliveryDate = $rateReply->TransitTime;
}else {
$deliveryDate='';
}
//End Transit Time or Deliver Time from Fedex
}
And Finally around line 284:
replace with:
$methods[] = array('id' => str_replace('_', '', $rateReply->ServiceType),
// Transit Time Edit Start
'title' => ucwords(strtolower(str_replace('_', ' ', $rateReply->ServiceType . ' : ' . $deliveryDate))),
// Transit time Edit End
'cost' => $cost);
}
}
Examples of what I see:
FedEx
(Total Items: 1 pcs. Total Weight: 3.85 lbs)
FedEx
Ground Home Delivery : One Day $9.77
Fedex Express Saver : 2012-03-09t19:00:00 $17.28
Fedex 2 Day : 2012-03-08t19:00:00 $18.24
Standard Overnight : 2012-03-07t15:00:00 $30.16
Priority Overnight : 2012-03-07t10:30:00 $35.25
First Overnight : 2012-03-07t08:30:00 $64.63
I have it working but it shows in a strange format and I need some help making it look better. Any help would be awesome.
Evan
#180
Posted 15 March 2012, 01:05
What I wanted to do is to apply Web Services V9 on my test site, before installing it on my live site.
Previously, I have been able to access Fedex Real Time rates both on my live site and test site.
At this point, I am not retrieving any rates on my test site, seeing a message:
Fatal error: Uncaught SoapFault exception: [HTTP] SSL support is not available in this build in /usr/local/apache2/htdocs/catalog/includes/modules/shipping/fedexwebservices.php:187\nStack trace:\n#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://gateway...', 'getRates', 1, 0)\n#1 [internal function]: SoapClient->__call('getRates', Array)\n#2 /usr/local/apache2/htdocs/catalog/includes/modules/shipping/fedexwebservices.php(187): SoapClient->getRates(Array)\n#3 /usr/local/apache2/htdocs/catalog/includes/classes/shipping.php(95): fedexwebservices->quote('')\n#4 /usr/local/apache2/htdocs/catalog/checkout_shipping.php(166): shipping->quote()\n#5 {main}\n thrown in /usr/local/apache2/htdocs/catalog/includes/modules/shipping/fedexwebservices.php on line 187
I called Fedex to ask about the “SSL support” in the error message, and they did not rule out that some modules are written that way - to require an SSL certificate, and I’m not sure if that is the case here. I was referred to their developers’ announcements page, which links to a downloadable certificate at http://images.fedex.com/us/developer/downloads/prod_cert.zip , which I am not sure on how to install on my test linux and apache environment anyway, if it is in fact the right approach to resolve this.
Feedback, anyone?














