Jump to content
Sign in to follow this  
sfatula

Just contributed - Fedex Shipping Quotes

Recommended Posts

Hi,

I have set up country of origin and postcode, and I have also made the changes recommended earlier (have tried with and without the changed code).

 

I'm still getting:

0,"311"2,"4071"3,"Cash only account"99,""0,"125"2,"5011"3,"No meter number."99,""

 

So I'm currently at a loss on how to continue....

Share this post


Link to post
Share on other sites

Mine is not showing the fedex ground rates, only the regular high ones. I cannot remember if it used to or not. How can we get it to show up?

Share this post


Link to post
Share on other sites

All,

 

The store_origin variables are set in the admin screens and you must set them up properly. Go to admin->configuration->shippng modules and make sure your Country Code and Postal Code are set up correctly.


Steve

Share this post


Link to post
Share on other sites

Cash only accounts don't work, they are cash only, Fedex does not rate quote them.

 

Thanks for the tip that later than MS1 versions changed the variables for the origin country and postal code, I am in Hawaii and did not look at newer versions yet.

 

The module returns what Fedex quotes. If fedex is not quoting say home delivery or ground rates, you'll want to make sure you have an account that can ship that way. Not all Fedex accounts are set up and approved to use ground shipping. This is a different Fedex truck and you have to be set up for this. If you are not, then Fedex does not quote it. My module doesn't calculate the rates, Fedex does based on your account number.

 

I plan a new release before long that takes into account the latest CURL changes that cause a problem here and there, the post MS1 variable changes, the ability to run CURL outside of the process for those not allowed to use CURL within PHP, and some debugging stuff.

 

For those with CURL problems, you'll want to contact the CURL folks for help with setting it up properly.


Steve

Share this post


Link to post
Share on other sites

v 1.11MS2 by jackhandy Integrated needed modifications as specified in the forums to get the FedEx module to work properly with MS2. (28-July-03)

 

Modifications included in this package came from the following forum topics:

 

Find the package here:

http://www.oscommerce.com/community/contributions,1187


jackhandy - http://jackhandy.com

Share this post


Link to post
Share on other sites

Thanks Jack, there will still be a later version soon with a lot of improvements, but this will keep people going who have a version later than MS1. I just don't have a functional MS2 site to work with at this time, but will shortly.


Steve

Share this post


Link to post
Share on other sites

Hey Steve,

 

Thanks for this awesome contribution! Got it working,a nd it looks great.

 

One major question, though -- how do you get this quoting envelope rate? All my products are just ounces, so I always use envelopes. The difference between a half pound or less box and an envelope going from my US location, to say, England, could be $20 -- around $30 for an envelope, almost $50 for the small box. Domestic box and envelope rates are much closer.

 

I don't want to overcharge anyone, though, and prefer to give the lowest shipping rates possible.

 

Any way to change this? I looked at the code, but couldn't find any obvious package type variables.

 

Regards,

Jon

Share this post


Link to post
Share on other sites

I guess I will turn your question around for a second. How do you specify your sub-pound letter weights, as opposed to sub-pound box rates?


Steve

Share this post


Link to post
Share on other sites
I guess I will turn your question around for a second. How do you specify your sub-pound letter weights, as opposed to sub-pound box rates?

 

Umm, I dunno. I never ship anything big enough to go in a box.

 

All items are spec'ed at something like .05 pounds. They're just little viles and whatnot. I should probably reduce the weights even more. I usually give people flat rate shipping, but a contrib like this needs the weights to be accurate, and I'd hate to see an order total up to more than .5 pounds (the max for an international envelope), when it's actually under that.

 

On the fedex website, it lets me select between a fedex envelope, box, or my own packaging (in which case it asks for dimensions). I can't see where to specify this in your script.

Share this post


Link to post
Share on other sites

By the way, I do get the same exact rates on the Fedex site with their rate quoter as your script spits out (for box size, anyway), so that's not an issue. I just need to specify a packaging type somehow.

Share this post


Link to post
Share on other sites

Ok, let me get this straight. You *NEVER* ship boxes of anything. So, it is unimportant to you if my module cannot distinguish between letter and box, as long as it picks letter, right? On the Fedex web site, yes, YOU can pick it, but I see no systematic way for OSC to tell me if a given item is a letter type package, or a box. So, if that is fine, then I am sure I can tell you how to specify letter for all quotes. It may require converting .05 pounds to ounces. Don't remember off hand.

 

So, tell me if I got it right.


Steve

Share this post


Link to post
Share on other sites
Ok, let me get this straight. You *NEVER* ship boxes of anything. So, it is unimportant to you if my module cannot distinguish between letter and box, as long as it picks letter, right? On the Fedex web site, yes, YOU can pick it, but I see no systematic way for OSC to tell me if a given item is a letter type package, or a box. So, if that is fine, then I am sure I can tell you how to specify letter for all quotes. It may require converting .05 pounds to ounces. Don't remember off hand.

 

So, tell me if I got it right.

 

Yeah, you got it. I never ever ship boxes from my retail site. Everything is too small and too light. I've never needed to yet, but I'd probably split up a big order in multiple envelopes. The Fedex calc wouldn't have to do that, though. On an order that large, I'd just comp the extra shipping, probably. Makes it easier, and is nice to the customer.

 

So you think doing envelopes is possible? That'd be greaaat! :)

Share this post


Link to post
Share on other sites

Curl on my server is located at: "/usr/bin/curl"

 

So when the script runs I get the typical:

 

Fatal error: Call to undefined function: curl_init() in /home2/dmg/public_html/test/includes/modules/shipping/fedex1.php on line 165

 

error.

 

I noticed that the Airborne Express contribution has in it's code a part that calls for Curl in /usr/bin/curl I.E.:

exec("/usr/bin/curl -d "$request" https://eCommerce.airborne.com/$api", $response);

 

Is there a way to modify the Curl calls in this Fedex contribution to call Curl from /usr/bin/Curl...?

function _AccessFedex($data) {

     $ch = curl_init();

and so on is where the calls take place in this fedex module... I tried changing all the calls to something like:

$ch = exec("/usr/bin/curl -d curl_init()");

while that removed the error message, it didn't seem to work (no data in the $reply string)... of course I was just guessing. I have no idea how to call a Curl command, much less from a specific location. Any ideas?


-D. M. 8)

Share this post


Link to post
Share on other sites

I have a suggestion. For the different domestic and international methods of shipment it may be better to make these selectable in the admin. The new version of the USPS shipping mod has done this and may be good to model after. In the admin, whenever the other FedEx shipping options are setup, there can be a multiselect box that allows the user to pick their own shipping options.


Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.

Share this post


Link to post
Share on other sites

I've got the contrib working great, I've noticed just one problem, my install never seems to use the domestic shipping types, it matters not which ones I comment out, it only uses the international types. I know why I just dont know whats causing it.

 

In fedex1.php I added some debugging output around line 298 in the form of

 

echo "delivery country" . $order->delivery['country']['id'];

echo "store country" . STORE_COUNTRY;

 

I get a country code 223 for the store country and 240 for the delivery country, this sets $this->intl to true so it ignores the domestic shipping types. What I cannot figure out is where it gets $order->delivery['country']['id']; from? I assume 223 is the US but what country is 240 and where did it come from? Can anyone shed some light?

 

 

Thanks,

Jason Weir

Share this post


Link to post
Share on other sites

I see the latest is for MS2.2, but we use MS2.1 and after all the work we've put into it, are reluctant to change until we have too....so, for the Fedex Direct contribution, which version should we install for OSC vMS2.1? The v1.11 (April release) or v1.11MS2 (July release)?

 

Thanks,

Brian

Share this post


Link to post
Share on other sites

I've been watching and reading this thread for a while and I just had to add my 2 cents.

 

While the contribution is great, I must say it was the most pain getting up and running.

 

Now, when I finally was sure everything is working, about a week ago new problem surfaced -- FedEx is not quoting Ground or Home Delivery rates any more.

 

I got so frustrated with this one, that I actually sat down and studied the FedEx interface. Verified most of the codes FedEx module is sending and FedEx reply string.

 

Everything looks in order, but it only quotes types 1 through 5 (no 90 or 92).

 

Could it be because I am still on the Test (beta) server? If so, this is another pain in the @ss. I have been talking to FedEx support and they say that I need to send them letter explaining purpose, process and what not before they authorize my moving from Test server to Production.

 

Did everyone out there had to go through the same tedious process? Any ideas what could be causing Ground rates not to appear?

 

Thanks!

Adi Rabinovich

http://WorldDelights.com

Share this post


Link to post
Share on other sites

adir1,

 

I posted this in another thread:

 

http://forums.oscommerce.com/viewtopic.php...p=204101#204101

 

I'm so proud of myself (me not being any way, shape, or form of a programmer).

 

I looked at the code in /includes/modules/shipping/fedex1.php and changed:

 

case 92:

if ($order->delivery['company'] == '') {

$skip = TRUE;

 

to:

 

case 92:

if ($order->delivery['company'] != '') {

$skip = TRUE;

 

and yeahhhhhhhh!!!! it now shows "ground service" along with all the rest.

Just wanted to post this hoping it will help someone else.

 

Maybe this is it , I don't know

Share this post


Link to post
Share on other sites

Dear RandyR,

 

Looks like the fix isn't it. Furthermore, I think the code the way it is originally written is correct.

 

What it tries to accomplish is to show Home Delivery service for orders that are DO NOT include Company name in the address.

 

And if the order DOES include Company name in the address, it will only show Ground Service instead of Home Delivery.

 

Unfortunatelly, in my case, neither is showing. And As I mentioned before, I am reviewing the FedEx reply stream and it's just not providing Ground or Home services as options at all....

 

Anyone out there has more ideas?

 

Thanks!

Adi Rabinovich

http://WorldDelights.com

Share this post


Link to post
Share on other sites

Hi,

 

I am trying to to register for an FedEx account, but I am from Europe, and the registration form gives me only 2 options, USA and CANADA.

 

My question is, It is possible sign up an account for non USA residents?

 

 

Best Regards.

Share this post


Link to post
Share on other sites

How can it know if there is a company name in the address? Please explaing this. I see no separate box for company name, only the First Name and Last Name boxes. I checked a couple of other oscommerce sites and they are the same.

Share this post


Link to post
Share on other sites

A few answers...

 

Company Name is standard in OSC, when a customer fills in their shipping address, or, asks for the customers information, it does ask for company, so that's how it knows. While it sounds stupid, Fedex distinguishes between HOME DELIVERY and GROUND. If you mark an order for GROUND, and it's a HOME DELIVERY, I find a large percentage of the time it's gets stuck for a few extra days, or even returned as it was to me a few times. And vice-versa. Therefore, we provide the same functionality as Fedex and quote the same way with the same terms as their web site and standards. I do not know why you do not show company name in your version of OSC, what version is it? Mine does for MS2, and it did for MS2, and it did for MS1, and the version just before MS1.

 

To Adi, you are probably using the test server. While it would be nice for all of this to work so easily, we are dealing with a vendor here who calls their DEVELOPMENT server a customer TEST server. It is not. So, there are frequent problems with the test server, which unfortunately makes it look like the module is not working, but it is. My account does not show ground or home delivery on the test server, just express. But, works perfectly on the production server. So, in the about to be released new version 2.0 of this module, I have simplified things as experience has shown no need to really go through the test server even though they say you must. This was all very confusing, and their information turned out to not be correct as far as having to go through the test server process. it doesn't help when the vendor provides mis-information.

 

The July release I don't think works for MS1, the earlier one did. The 2.0 coming out very shortly will work with both and will be easier to get working.

 

To Jason, the delivery country ID comes from OSC. The customer picks this when they choose a delivery address off of the country list. 223 is US in the COUNTRIES table, 240 is not in my list. I looked in the MS2 install, there is no 240 defined. perhaps you have a duplicate US entry in the countries table? Take a look at it, if so, you'll have to patch it up...

 

gpraceman, I have not seen the USPS shipping module you are speaking of. I have MS2 running now, and there is no box as you describe. Are you speaking of some add on contribution perhaps, not the standard USPS module that comes with MS2? I would be happy to add similar functionality as that would be the last reason to edit fedex1.php

 

dmGremlin - your hosting service did not compile PHP --with-curl. So, you would need to run outside of PHP via exec. Most hosting companies do have safe mode turned on, meaning, they have to still enable you to run it "outside" of PHP via exec. So, if you are using an Airborne module, and it works, then they must have done so. The GOOD news is 2.0 supports this also! So, watch for it. It works for me at least outside of PHP via exec. Though I would recommend using the non exec way for those who can.

 

Brief list of changes so far:

 

Easier install!

 

No need to edit fedex1.php, moved to ADMIN screen (except commenting out shipping methods, will look into the multi select like some USPS module has once I see it, so maybe 2.1)

 

debug mode to help problem solving

 

no need to specify server names (Fedex confuses them all the time anyway)

 

Shows Fedex error messages instead of the standard message when a problem occurs. So, if a customer uses an invalid postal code for example, it says so! But, we are limited to the messages Fedex provides, which so far look farily good.

 

Option to exec cURL

 

Support for KGS or LBS as weight units

 

Timeout length in seconds (Fedex has problems today and over the weekend with their production server, a timeout does help)

 

Works with MS2, or earlier

 

Sort rates ascending or descending

 

A few minor bug fixes (such as a customer that specifies a zip code of 75454-8916 for example). This actually causes Fedex to choke and not quote a rate!

 

Possibly envelope rates, looking into this, might have to wait for 2.1

 

Once this is out there, you will have to turn off the current module, load the new software, and then turn it back on so it can delete the old keys in Admin, and add the new ones properly and not get confused.

 

Anyway, I am going to open a new thread when 2.0 comes out as this thread should die. 2.0 will be the version to use.


Steve

Share this post


Link to post
Share on other sites
gpraceman, I have not seen the USPS shipping module you are speaking of. I have MS2 running now, and there is no box as you describe. Are you speaking of some add on contribution perhaps, not the standard USPS module that comes with MS2? I would be happy to add similar functionality as that would be the last reason to edit fedex1.php

 

The USPS contribution that I mention is at http://www.oscommerce.com/community/contributions,487

 

The latest version of this, for MS2, has two configuration keys, one for domestic shipping options and the other for international. In the admin, when you setup the other shipping options you can select which shipping options you wish to offer. Hopefully, it wouldn't be too hard to replicate this functionality with the FedEx contrib.

 

tep_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Domestic Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES', 'Express, Priority, First Class, Parcel', 'Select the domestic services to be offered:', '6', '14', 'tep_cfg_select_multioption(array('Express', 'Priority', 'First Class', 'Parcel'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Int'l Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES_INTL', 'GXG Document, GXG Non-Document, Express, Priority Lg, Priority Sm, Priority Var, Airmail Letter, Airmail Parcel, Surface Letter, Surface Post', 'Select the international services to be offered:', '6', '15', 'tep_cfg_select_multioption(array('GXG Document', 'GXG Non-Document', 'Express', 'Priority Lg', 'Priority Sm', 'Priority Var', 'Airmail Letter', 'Airmail Parcel', 'Surface Letter', 'Surface Post'), ', now())");


Awana Grand Prix and Pinewood Derby racing - Where a child, an adult and a small block of wood combine for a lot of fun and memories.

Share this post


Link to post
Share on other sites

Ah I see now, gpraceman, I will add this also. But it uses multioption, which is not standard OSC. So, maybe in 2.1. I don't want to get in a situation where the contribs conflict with each other when a change is made, so will give it some thought.


Steve

Share this post


Link to post
Share on other sites

Well I found I had turned Customer Name off in Admin. Turned it back on. Now when I click Cart Contents I hangs forever and finally shows up sometimes and sometime never. Turned off fedex in admin and it goes right to shipping so it is in the fedex module somehow.

 

DO you know what it could be?

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
Sign in to follow this  

×