Jump to content
greasemonkey

FedEx - Web Services v9

Recommended Posts

it fixed one thing but I got this

 

Fatal error: Cannot redeclare cleanFedexAddress() (previously declared in /home/bourques/public_html/includes/languages/english/modules/shipping/fedexwebservices.php:13) in/home/bourques/public_html/includes/modules/shipping/fedexwebservices.php on line 16

Share this post


Link to post
Share on other sites

Hi all,

 

This module seems to be running ok. I am getting the rates but the only thing is that The Ground Home Delivery always says 1 day, which seems incorrect.

 

 

First Overnight $61.05

Priority Overnight $20.57

Standard Overnight $19.00

Fedex 2 Day $12.84

Fedex Express Saver $12.34

Ground Home Delivery (1 day) $8.60

 

Does anyone know if there any way I can change this to say (3-5 business days) instead?

Edited by jchouman

Share this post


Link to post
Share on other sites

Does anyone know if there any way I can change this to say (3-5 business days) instead?

 

The number of days shown is determined by the address you are shipping to. Try quoting a zip code farther from you... the days should change accordingly.

 

If you want to manually override - you would have to change this block of code

$show_box_weight = " (Total items: " . $shipping_num_boxes . ' pcs. Total weight: '.number_format($shipping_weight * $shipping_num_boxes,2).' '.strtolower(MODULE_SHIPPING_FEDEX_WEB_SERVICES_WEIGHT).'s.)';
$this->quotes = array('id' => $this->code,
'module' => $this->title . $show_box_weight,
'info' => $this->info());


-Dave

Share this post


Link to post
Share on other sites

The number of days shown is determined by the address you are shipping to. Try quoting a zip code farther from you... the days should change accordingly.

 

If you want to manually override - you would have to change this block of code

$show_box_weight = " (Total items: " . $shipping_num_boxes . ' pcs. Total weight: '.number_format($shipping_weight * $shipping_num_boxes,2).' '.strtolower(MODULE_SHIPPING_FEDEX_WEB_SERVICES_WEIGHT).'s.)';
$this->quotes = array('id' => $this->code,
'module' => $this->title . $show_box_weight,
'info' => $this->info());

 

Thanks for this.

Share this post


Link to post
Share on other sites

to change the number of days for delivery, I changed this line in fedexwebservices.php

$transitTime = ' (' . str_replace(array('_', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteeen'), array(' ', 4,5,6,7,8,9,10,10,10,10,11,12,13,14), strtolower($rateReply->TransitTime)) . ')';

 

this ' ', 4,5,6,7,8,9,10,10,10,10,11,12,13,14 in original file was this ' ', 1,2,3,4,5,6,7,8,9,10,11,12,13,14

I just wanted to add 3 days for order processing and changed those digits.

 

seems to work for me

---------------------------------------------------------------------------

 

I still can't figure out how to print Home and Ground labels, can only do either or by changing 'Residential' => false) in fedexwebservices.php . Residential address checker just does not get passed to Fedex when I select Home Delivery I get an error that she shipment must be designated as residential... it worked fine in the old version. There is this piece of code in

ship_fedex.php

// if it's home delivery (90), add the "residential delivery flag" (440)

if ($HTTP_POST_VARS['service_type'] == 90) {

$shipData[440] = 'Y';

}

else {

$shipData[440] = 'N';

}

 

but it doesn't seem to do anything...any ideas on this? Any help would be appreciated.

Share this post


Link to post
Share on other sites

Keep in mind.... I'm no coder. However, the webservices version of fedex labels I posted does not use that line in ship_fedex.php (leftovers from the old mod).

 

As long as you choose line 382 in ship_fedex.php

 

 $service_type[] = array('id' => 'GROUND_HOME_DELIVERY', 'text' => 'FedEx Ground Home Delivery');

 

This would get past to 529 in webservices.php

 

  'ServiceType' => $fedexRequestData['shipData']['service_type'], // valid values STANDARD_OVERNIGHT, PRIORITY_OVERNIGHT, FEDEX_GROUND, ...

 

It matches line 3985 in Shipservices_v10.php... so it should work?

 

	  <xs:enumeration value="GROUND_HOME_DELIVERY"/>

 

Hopefully someone with more "smarts" then me can help...

Share this post


Link to post
Share on other sites

@@Roaddoctor

Hi Dave,

It turns out that I'm still getting that error after performing all the fixes.

Fatal error: Call to a member function show_total() on a non-object in /includes/modules/shipping/fedexwebservices.php on line 127

You last suggestion to change:

$totals = $order->info['subtotal'] || $_SESSION['cart']->show_total();

to:

$totals = $cart->show_total();

works. At first, the shipping methods aren't showing. But when I add an item to the order and the page refreshes, that's when the shipping methods appear.

 

Thanks.

Edited by Irin

Share this post


Link to post
Share on other sites

Has anyone experimented with the signature options??

 

I need to add adult signature required ($4.50 at our price), but it doesn't appear to be working.

 

I tried this:

 

if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_SIGNATURE_OPTION >= 0 && $totals >= MODULE_SHIPPING_FEDEX_WEB_SERVICES_SIGNATURE_OPTION) {
    $request['RequestedShipment']['SpecialServicesRequested'] = 'SIGNATURE_OPTION'; 
     $request['RequestedShipment']['SignatureOptionDetail'][] = array('OptionType' => 'ADULT','SignatureReleaseNumber' => '');
}

Edited by sonofsmog

Share this post


Link to post
Share on other sites

I am using FedEx Webservice Version 9.4.2 with a new OSC 2.3.3 installation. It has been working okay for domestic (USA) addresses but, for international addresses, it is offering priority and economy options for just the handling fee.

 

Any guesses as to why it would be doing this or, suggestions on how to troubleshoot?

Share this post


Link to post
Share on other sites

I have identified two separate issues. The first is that FedEx returns the international data using PAYOR_LIST_SHIPMENT instead of PAYOR_LIST_PACKAGE. Otherwise, on cursory inspection, the data format appears the same. So, modifying line 310 to this:

 

if($ShipmentRateDetail->ShipmentRateDetail->RateType==('PAYOR_LIST_PACKAGE' || 'PAYOR_LIST_SHIPMENT'))

 

... fixes the problem for some international addresses.

 

For my Canadian test address, FedEx is returning "There are no valid services available." So, I guess FedEx no longer offers service to Canada. ;)

Share this post


Link to post
Share on other sites

@@lachitmonstar Did you ever find a solution? I would like to reverse the results as well.

 

Hi, I istall this contribution (http://addons.oscommerce.com/info/7977) sucessfully and it's 100% working. I have a issue with this contribution, Currently shipping cost are showing high to low format.

 

Priority Overnight $171.45

Fedex 2 Day $69.96

Fedex Express Saver $52.32

Fedex Ground (3 days) $27.54

 

But I want to change it like (LOW to HIGH format)

 

Fedex Ground (3 days) $27.54

Fedex Express Saver $52.32

Fedex 2 Day $69.96

Priority Overnight $171.45

 

Is it possible, please help!

 

Thanks in advance.

Share this post


Link to post
Share on other sites

The function to sort low to high is done usort, which is probably commented out. Look for the line below and uncomment it.

// usort($methods, 'cmp');

But I beleive you have to move the "cmp" function so it's like

function cmp($a, $B) {
 if ($a['cost'] == $b['cost']) {
	 return 0;
 }
 return ($a['cost'] < $b['cost']) ? -1 : 1;
}

usort($methods, 'cmp');

 

This should solve your problem but post back if not.

Edited by John W

I'm not really a dog.

Share this post


Link to post
Share on other sites

I see some mention of international proplems, but not this particular one.

Seems customers in canada can select regular domestic ground at checkout, international ground is NOT a presented option.

Not sure how this can be, since it is international ground.

AFAIK only international options should be all that is returned via the api

 

The rate is about half of what it should be.

Sorry but I am not out of pocketing 37 bucks on a sale under 300.

 

It shows domestic in checkout_shipping.php

I do notice that it does NOT appear as a choice in order editor.

 

international ground is turned on in the console

appears to be correct in the code (wsdl and fedexwebservices)

Guess I have to reach out to tech at fedex to see if this issue is a reported bug.

 

Any insight, or answer I missed in the thread?

Share this post


Link to post
Share on other sites

I see some mention of international proplems, but not this particular one.

Seems customers in canada can select regular domestic ground at checkout, international ground is NOT a presented option.

Not sure how this can be, since it is international ground.

AFAIK only international options should be all that is returned via the api

 

The rate is about half of what it should be.

Sorry but I am not out of pocketing 37 bucks on a sale under 300.

 

It shows domestic in checkout_shipping.php

I do notice that it does NOT appear as a choice in order editor.

 

international ground is turned on in the console

appears to be correct in the code (wsdl and fedexwebservices)

Guess I have to reach out to tech at fedex to see if this issue is a reported bug.

 

Any insight, or answer I missed in the thread?

 

I'm also having this problem. If you turn on international ground and turn off regular ground no shipping cost is added to the order. If you turn off international ground and turn on regular ground the shipping cost does not show up. The only way any cost for shipping shows up for shipments to Canada is when both international AND domestic ground is enabled. Other international rates such as international priority and economy show up as $0.00 for shipments to Canada.

 

Also the contribution does not appear to send value statement to FedEx.

 

Any help would be appreciated.

Share this post


Link to post
Share on other sites

Did you start with a clean install?

If so, which version?

 

Or are you customized at all?

 

Do you have error reporting turned on?

 

You make no mention if domestic works normally or not.

Seems you have install or configuration issues, or possible imcompatibilities.

 

 

I have nearly 30 contribs added to my original 2.2 rc2 install.

It is now ported for php 5.3

Lunarpages went from 4.6 to 5.3 with 36 hours notice over labor day weekend.

There went nearly 70 hours of my life to deal with deprecations, research, revisions and testing.

Error reporting is on.

 

 

I'm also having this problem.

 

Your orders when selected to canadian destinations, show domestic, not the international ground option with a rate value (not 0.00)?

 

 

If you turn on international ground and turn off regular ground no shipping cost is added to the order. If you turn off international ground and turn on regular ground the shipping cost does not show up. The only way any cost for shipping shows up for shipments to Canada is when both international AND domestic ground is enabled.

 

I have not experienced that, I believe I can select any combination.

In my case Rates always display, just not the right rate type - in the cart

Manual order editor it shows the right type and total of the rate.

 

You appear to have multiple issues, which leads me to believe you have an integration issue.

 

 

Other international rates such as international priority and economy show up as $0.00 for shipments to Canada.

 

Nope, again, all enabled international rates except international ground report.

In its place, is domestic ground with a rate.

post-177858-0-49989600-1350740320_thumb.png

Click the pic to see what is appearing.

 

Also the contribution does not appear to send value statement to FedEx.

 

Not sure what you mean "value statement" - as in insured worth? customs value?

 

All works fine for me, except the domestic ground in place of international ground in the cart checkout process.

 

 

Any help would be appreciated.

 

I think you need to go over your installation with a fine tooth comb and make sure you performed each and every step.

Confirm that you have the updated validated meter from fedex, as the original meters we were issues are deprecated, and new number is assigned, as is a new key.

 

 

My belief is you have seperate issues from what I am experiencing.

Share this post


Link to post
Share on other sites

One error in explaining the problem, BOTH manual order editor and checkout_shipping are reporting the wrong rate.

I did not discover the problem until creating the customers label in fedex.com console.

 

I looked through all the code and it appears to be filtering correctly.

Any thoughts on how the returned array is replacing the international rate with the domestic?

 

Insight appreciated.

 

Corey

Minions Web

Share this post


Link to post
Share on other sites

For all of you having Order Editor issues, please try this line and report back.... thanks!

 

replace the one occurence of line (you may have any one of these):

 

$totals = $order->info['subtotal'] = $_SESSION['cart']->show_total(); // original code
$totals = $cart->show_total(); // this seems to work?
$totals = $order->info['subtotal'] || $_SESSION['cart']->show_total(); // or perhaps this is better ?

 

With:

 

$totals = $order->info['subtotal'] = $cart->total; // testing this

 

please let me know the result, along with your version of OE

Edited by Roaddoctor

-Dave

Share this post


Link to post
Share on other sites

Did you start with a clean install?

If so, which version?

 

Or are you customized at all?

 

Do you have error reporting turned on?

 

You make no mention if domestic works normally or not.

Seems you have install or configuration issues, or possible imcompatibilities.

 

 

I have nearly 30 contribs added to my original 2.2 rc2 install.

It is now ported for php 5.3

Lunarpages went from 4.6 to 5.3 with 36 hours notice over labor day weekend.

There went nearly 70 hours of my life to deal with deprecations, research, revisions and testing.

Error reporting is on.

 

 

 

 

Your orders when selected to canadian destinations, show domestic, not the international ground option with a rate value (not 0.00)?

 

 

 

 

I have not experienced that, I believe I can select any combination.

In my case Rates always display, just not the right rate type - in the cart

Manual order editor it shows the right type and total of the rate.

 

You appear to have multiple issues, which leads me to believe you have an integration issue.

 

 

 

 

Nope, again, all enabled international rates except international ground report.

In its place, is domestic ground with a rate.

post-177858-0-49989600-1350740320_thumb.png

Click the pic to see what is appearing.

 

 

 

Not sure what you mean "value statement" - as in insured worth? customs value?

 

All works fine for me, except the domestic ground in place of international ground in the cart checkout process.

 

 

 

 

I think you need to go over your installation with a fine tooth comb and make sure you performed each and every step.

Confirm that you have the updated validated meter from fedex, as the original meters we were issues are deprecated, and new number is assigned, as is a new key.

 

 

My belief is you have seperate issues from what I am experiencing.

 

 

Small number of add-ons. Just FedEx for shipping. Don't offer any other shipping method but do have COD add-on for FedEx. PayPal Web Payments Pro and Express. Discount Coupons. Minimum order add-on.

 

Original installation was 2.2MS2.

 

Found part of the problem. Had FedEx list rates chosen. Changed that to Account and the international air rates showed up. Turned error reporting on but did not show any errors. Domestic rates show up normally.

 

So the major problem is that the internation ground rate to Canada is well under the rate charged by FedEx. Example: a 1.8 lb package valued at $66.00 shows a rate of $23.84 but when checked on FedEx website the rate is twice that much. It is like the shipping cost is sent without the value and import duties or whatever it is they call that.

Share this post


Link to post
Share on other sites

You are correct - this module does not account for the customs or brokerage fees that may occur. You would need to code this in or hire a developer to do it for you. If you develop a fix we hope you will share. Quick and dirty short term fix would be to hardcode a brokerage charge and customs surcharge into the international rates.


-Dave

Share this post


Link to post
Share on other sites

Dave,

I am seeing domestic ground rates, not international ground rate for canada ground ship.

Screen capture is in the link above to illustrate what I mean.

Any insight?

Share this post


Link to post
Share on other sites

Dave,

I am seeing domestic ground rates, not international ground rate for canada ground ship.

Screen capture is in the link above to illustrate what I mean.

Any insight?

 

I tested this on our shop and found that the text output does indeed read "FedEx Ground", but the rate was correct for Intl Ground to Canada.


-Dave

Share this post


Link to post
Share on other sites

odd, in my shop it was drastically off.

reviewing in fedex console the rate provided (stating transportation fees) shows as 74.40

 

FedEx International Ground®

(2 Business Days)

Base Rate

24.25

Additional charges (+)

+Fuel surcharge

1.84

+Canada HST

5.33

+Declared Value

3.20

+Clearance Entry Fee

40.99

Discounts (-)

-Earned discount

(--)

-Volume discount

(1.21)

-Bonus discount

(--)

Total

74.40

 

 

in the shop, it shows 37.09

Big disparity.

 

I feel like I am missing something.

 

Am I?

 

Thanks

Corey

Edited by minionsweb

Share this post


Link to post
Share on other sites

I feel like I am missing something.

 

Am I?

 

Thanks

Corey

yes, its the same issue as above-

It seems this module does not yet account for the customs or brokerage fees that may occur. You would need to code this in or hire a developer to do it for you. If you develop a fix we hope you will share. Quick and dirty short term fix would be to hardcode a brokerage charge and customs surcharge into the international rates.

 

Dave


-Dave

Share this post


Link to post
Share on other sites

Minionsweb and rcritt,

 

Please try replacing the following line and see if you have any different results on international ground rates.. Please let us know.

 

Replce

   if($ShipmentRateDetail->ShipmentRateDetail->RateType=='PAYOR_LIST_PACKAGE')

 

With

   if($ShipmentRateDetail->ShipmentRateDetail->RateType==('PAYOR_LIST_PACKAGE' || 'PAYOR_LIST_SHIPMENT'))


-Dave

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×