Latest News: (loading..)
Sign in to follow this  
Followers 0
spoot

Automated FedEx Labels

714 posts in this topic

The automated fedex labels contribution is an addition to the administrative pages that retrieves label data from FedEx.

 

To use this contribution, you must have a FedEx account number.

 

In order to get on FedEx's production server, you must contact FedEx directly. They will have you, uh, FedEx your printed labels to them. When they give you their OK, you can go live. These labels come directly from FedEx, so they should pass the test.

Share this post


Link to post
Share on other sites

I put the contribution on my test system and i am getting a cURL error :

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

This transaction could not be completed. Please note the error message below.

 

ERROR: cURL ERROR: 60: error setting certificate verify locations

unable to process ship_ground

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

I've been using the fedex direct rates with out a problem, so I think cURL is operating correctly.

 

The error has to do with certificate read or access problems. I don't know if it's my machine or Fedex. On this machine I set the complete path and crt files world readable/writeable still get same error.

 

I searched the forums and all I came up with was payment module problems having to do with self certification.

Has any one had this problem Fedex or have a fix?

 

two more minor problems:

Can only ship ground or home delivery in contrib ship_fedex.php page.

- wanted to test regular fedex shipping. need to modify page to allow reg fedex.

manifest picks up customer placing order as send to name rather than shipping name when using another address book name and address.

 

 

Running suse linux 9.0, apache 1.3,

php 4.3.3

 

All pathes up to date.

CURL:

enabled

CURL Information libcurl/7.10.5 OpenSSL/0.9.7b ipv6 zlib/1.1.4

 

Any help or advice would be apperciated.

 

Thanks

Share this post


Link to post
Share on other sites
------------------

This transaction could not be completed. Please note the error message below.

 

ERROR: cURL ERROR: 60: error setting certificate verify locations

unable to process ship_ground

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

 

Check the variables at the top of the two fedexdc.php files.

 

$server = 'test'; // which fedex server to use: test or production
$request_referer = 'localhost'; // base url for site, e.g.: 'yoursite.com'

 

They should say something like that. You probably have to change the request_referer variable to an appropriate server name for your system. (This was the case for me when I had a similar cURL error.)

 

I'll try to add some administrative features in a later release, though for some reason I found they were hard to access with fedexdc.php - I forget why though.

 

Can only ship ground or home delivery in contrib ship_fedex.php page.

 

That's because I'd commented all the other options out of ship_fedex.php, & forgot to uncomment them. The options start at line 472; leave as many or as few in as you like.

 

manifest picks up customer placing order as send to name rather than shipping name when using another address book name and address.

 

That's an oversight - I never messed with the manifest & address book entries. I'll try to make an update soon.

 

I hope this helps, let me know how it goes -

 

Michael

Share this post


Link to post
Share on other sites

I'm getting two error messages when using this contrib. any ideas on them?

 

when opening

catalog/track_fedex.php:

 

Warning: fopen(images/fedex/post.txt): failed to open stream: No such file or directory in /home/u2/fontanasports/html/catalog/includes/fedexdc.php on line 309

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/u2/fontanasports/html/catalog/includes/fedexdc.php on line 310

ERROR :FedEx Return Error 500139 : No scan record for this shipment has been received by our system yet. Please try again later or contact Customer Service at 1.800.Go.FedEx® 800.463.3339.

 

when opening

catalog/admin/track_fedex.php:

 

Warning: main(DIR_WS_MODULES_SHIPPINGfedexdc.php): failed to open stream: No such file or directory in /home/u2/fontanasports/html/catalog/admin/track_fedex.php on line 11

 

Warning: main(): Failed opening 'DIR_WS_MODULES_SHIPPINGfedexdc.php' for inclusion (include_path='.:') in /home/u2/fontanasports/html/catalog/admin/track_fedex.php on line 11

 

Fatal error: Cannot instantiate non-existent class: fedexdc in /home/u2/fontanasports/html/catalog/admin/track_fedex.php on line 15

 

 

any ideas would be appreciated

 

Ryan

Share this post


Link to post
Share on other sites

Ryan -

 

On line 11 of admin/track_fedex.php, change:

 

 

include(DIR_WS_MODULES_SHIPPING . 'fedexdc.php');

 

 

to

 

 

include(DIR_WS_INCLUDES . 'fedexdc.php');

 

 

I've posted a new version that includes this fix.

 

Michael

Share this post


Link to post
Share on other sites

Michael-

 

One other thing. When a customer tries to track the status, they get an

 

Warning: fopen(images/fedex/post.txt): failed to open stream: No such file or directory in /home/u2/fontanasports/html/catalog/includes/fedexdc.php on line 309

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/u2/fontanasports/html/catalog/includes/fedexdc.php on line 310

ERROR :FedEx Return Error 500139 : No scan record for this shipment has been received by our system yet. Please try again later or contact Customer Service at 1.800.Go.FedEx? 800.463.3339.

 

 

*******

This is because its calling on /images/fedex/post.txt, when in fact this file is located in /admin/images/fedex/post.txt .

 

Ryan

Share this post


Link to post
Share on other sites

Oh, heck. Try replacing fedexdc.php line 309. It's currently:

 

$fp = fopen('images/fedex/post.txt', 'w');

 

Change to:

 

$fp = fopen('../images/fedex/post.txt', 'w');

 

There's no catalog/images/fedex directory, so I don't know why this would work... but it works on my test server.

 

If you change that line & it still gives an error, make a catalog/images/fedex directory & chmod it to 777.

Share this post


Link to post
Share on other sites

When using this module and requesting a courier, will fedex get the information that I am requesting or do I still need to call?

Share this post


Link to post
Share on other sites
When you use this module will it automaitcally let fedex know you requested a courier or do I need to do it manually

and does the billing go in when I print the label or when fedex picks em up?

 

and does cancel ship actually connect with fedex and cancell it there?

 

When you request a shipment, it's sending the request directly to FedEx. You tell them the date you want the pickup, and they should arrive on that date. (If they don't, it's their fault, not the module's.)

 

Cancel shipment connects directly to FedEx and cancels the shipment request for that package. (If there are multiple packages going out on that same day, FedEx should still show up to pickup the non-cancelled packages.)

Share this post


Link to post
Share on other sites

How well does this work if you already have a daily pickup. Also do you have some screen shots of how this works? Let me know. I may need some assistence installing. :)

Share this post


Link to post
Share on other sites

Does anyone know were i can change the code that would send notifaction to the customer and change the status to shipped instead of delivered? Is this possible

 

 

Date Added Customer Notified Status Comments

08/10/2004 06:00:52 Pending

08/10/2004 06:04:12 Delivered Scheduled shipment, tracking number

Share this post


Link to post
Share on other sites
How well does this work if you already have a daily pickup.  Also do you have some screen shots of how this works?  Let me know.  I may need some assistence installing.  :)

I started putting together a set of screen shots, but haven't finished it up just yet.

 

If you already have a daily pickup, you'll still get most of the benefits of this program: the labels labels and manifest created without having to reenter customer or order information anywhere, tracking data stored with the order, maybe some other stuff.

Share this post


Link to post
Share on other sites
Does anyone know were i can change the code that would send notifaction to the customer and change the status to shipped instead of delivered? Is this possible

 

 

Date Added Customer Notified Status Comments

08/10/2004 06:00:52  Pending 

08/10/2004 06:04:12  Delivered Scheduled shipment, tracking number

I believe all you need to do is:

 

- Add a "Shipped" option to the orders_status table with, say, an orders_status_id of 4.

 

- Change line 333 in ship_fedex.php:

 

[code[// ...mark the order record "delivered"...

$update_status = array ('orders_status' => 3);[/code]

 

Here, you'd want to change 'orders_status' => 3 to 'orders_status' => 4.

 

I may be missing something, but I think that's all you'll need to do. This seems like a useful feature.

 

Michael

Share this post


Link to post
Share on other sites

I?ve finally had time to look at this mod again and fix the error message:

 

ERROR: cURL ERROR: 60: error setting certificate verify locations

 

My research indicates using libcurl 7.xx or higher requires peer certificate verification when using ssl by default. It seems SuSe 9.1 openssl does not load the Certificate Authorities and adjust the ca-path automatically. I don?t have the time to look into setting the paths, but I have found a fix.

 

In fedexdc.php around line 293 in function _sendCurl() add:

 

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false):

 

This turns off the peer verification ? not the most secure way of fixing the problem, but it works

Share this post


Link to post
Share on other sites

Michael,

 

Works great. Couple of questions though. We have a Zebra thermal printer (supplied by FedEx) that we want to use. I see how to change the paper/printer/size variables in the string but I haven't figured out how to take the raw printer data coming back from FedEx and push it to ,in our case, LPT1 on the client interface. If we try to save this "ZPL2" file format it strips out the special characters and is then unusable.

 

Have you had any luck with thermal printer integration?

 

Jeff

Share this post


Link to post
Share on other sites
Have you had any luck with thermal printer integration?

Jeff -

 

I haven't tried anything but plain paper labels. To try a different label, though, edit lines 139 and/or 140 in ship_fedex.php:

 

,1369 => 1 // printer type (1 is laser)
,1370 => 5 // label media (5 is plain paper)

 

The options for each are:

 

1369:

1 = laser printer

2 = eltron orion (epl2)

3 = eltron eclipse (epl2)

4 = zebra zpl

5 = unimark

 

1370:

3 = Format 354 with doc tab information at bottom of label (4x6 ? thermal label)

4 = Format 435 without doc tab information (4x6 thermal label)

5 = Plain paper (PNG) - Supported for FedEx Ground and Express Shipping.

6 = Format 354 with doc tab information at top of label (4x6 ? thermal label)

 

Let me know how it goes -

 

Michael

Share this post


Link to post
Share on other sites

Michael,

 

I saw the output string vaviables. Unfortunatly it's not that easy. When you select to receive the label data from FedEx for a thermal printer. The data you receive is raw data (not an image) that needs to be decoded by the thermal printer itself. The issue then is how to get the data string coming back from FedEx to go directly into the thermal printer.

 

FedEx has a ActiveX controller that is prompt when you use the web service (fedex.com) to print thermal labels. I'm trying to use that controller with the admin' browsers interface of OSC.

 

Jeff

Share this post


Link to post
Share on other sites

Oh, right - we have to decode the PNG, so of course we have to decode whatever else we might be getting for the other formats. Damn. If I find any other options I'll let you know.

Share this post


Link to post
Share on other sites
The data you receive is raw data (not an image) that needs to be decoded by the thermal printer itself.

Jeff -

 

According to Jay Powers (the guy who made the fedexdc class this module uses):

 

Other than PNG the label data returned from FedEx is plain text. ?You just need to pipe it to a printer that accepts the chosen format.

 

Could this be true? Or is he talking crazy talk?

 

Let me know what you find out -

 

Michael

Share this post


Link to post
Share on other sites

Hello,

 

I've installed this contrib and get everything to work now "except" I can't see the actual "label" to even get a plain paper print out.

 

I get the fedex tracking number. It puts the order in delivered... (which I'll change to shipped, thanks to an earlier post)

 

But basically, when I enter in how many lbs, on the next screen that should show me the label to print, it's a broken image.

 

Could that be a problem with curl or something else? Maybe I'm just goofed somewhere? Probably the case, as it appears according to the rest of the post everyone else can at least "see" the label.

 

<sigh>

 

Thanks for your input!

 

James

Edited by Stormer

Share this post


Link to post
Share on other sites

Hello,

 

Just a follow up on my last post...

 

 

I just went and did it again. The png image is attempting to load from:

 

MYDOMAIN.COM/catalog/admin/images/fedex/462105310000033.png

 

So.. I went to that directory to see if anything was in it. I do see a text file called: post.txt

 

that file contains all the shipping information. Possibly the problem lay with my server not being able to generate a png file? I'm really not sure what that post.txt file has to do with anything. I'm guessing here.

 

Thanks again for any input you might have.

 

James

Edited by Stormer

Share this post


Link to post
Share on other sites

Hello All,

 

Another follow up on previous post.

 

It's FIXED. :rolleyes:

 

After corresponding with SteveC, he asked me to make sure the /admin/images/fedex was chmodded 777. When I went in, I noticed these images in the /admin

 

Aug 25 12:25 DIR_WS_FEDEX_LABELS462105310000002.png

Aug 25 12:26 DIR_WS_FEDEX_LABELS462105310000019.png

Sep 2 17:17 DIR_WS_FEDEX_LABELS462105310000026.png

Sep 2 17:38 DIR_WS_FEDEX_LABELS462105310000033.png

 

he simply told me:

 

edit:

catalog/admin/includes/configure.php and add the following lines some

where before the ending ?>

 

// fedex BOF

define('DIR_WS_FEDEX_LABELS', DIR_WS_IMAGES . 'fedex/');

// fedex EOF

 

 

It all works now.

 

This contrib was a bear to install in the first place, I am not at all surprised I missed this in the instructions. Or, maybe it wasn't in the instructions at all..LOL (that is doubtful since no one else was having this problem) But this was the fix.

 

thanks all.

 

James

Share this post


Link to post
Share on other sites

I'm going through the code, trying to figure this out, one line is confusing to me

// create new FedExDC object

$fed = new FedExDC($shipVars[0][10],$shipVars[1][498]);

 

Where does $shipVars get its values from? I dont see where its built....

 

Thanks!

Share this post


Link to post
Share on other sites

Thanks Michael for this great contribution. It is really a life savor. :lol:

 

We use Fedex almost exclusively to ship and this contribution really saves lots of time on generating shipping labels.

 

I do have one question though. I noticed that this contribution is for Daily pickup only. Is that possible to add a "drop off" option so that people can have more flexbility.

 

The installation did take me a while. Your instruction is really easy to follow.

 

Thanks.

 

Wendy

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  
Followers 0