Jump to content
Sign in to follow this  
spoot

Automated FedEx Labels

Recommended Posts

Ive had problems getting approval to move to the production server from FedEx. They claim the barcode is not within their dimensions. Also, when I use the 'Print Page' feature in fedex_popup.php, my print result is black, like it was inverted...

 

Anyone else run into problems getting certification with FedEx?

Share this post


Link to post
Share on other sites
Ive had problems getting approval to move to the production server from FedEx. They claim the barcode is not within their dimensions. Also, when I use the 'Print Page' feature in fedex_popup.php, my print result is black, like it was inverted...

 

Anyone else run into problems getting certification with FedEx?

You'll need to compare the label you're printing to a standard FedEx label, & make sure it's printing to the right size. This will depend on your printer & monitor... but in any case, you adjust the size of the printed label on line 63 of fedex_popup.php:

 

var resolution = 96;

 

Try changing that to 64 or 128, or anything else for that matter. Smaller number prints bigger, bigger number prints smaller (I think).

 

I'm not sure about the printing black/printing inverted problem. I don't believe a browser can have that kind of impact on a printer; and whether you click the "print" button, Ctrl+p, or File/Print, it's all the same to your system.

Share this post


Link to post
Share on other sites

Works just fine for a single package, however for multiple I get the following error returned:

 

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

 

ERROR: FedEx Return Error 1219 : Invalid package count or package sequence exceeds package count

 

Running in debug mode I get this:

 

Shipment request data, package #1:

Array
(
   [0] => 21
   [16] => PA
   [13] => 114  drive
   [1273] => 01
   [1274] => 05
   [18] => 5555551212
   [15] => atown
   [23] => 01
   [117] => US
   [17] => 18104
   [50] => US
   [11] => 
   [12] => Anthony DeSalvatore
   [1333] => 1
   [1415] => 400.00
   [1368] => 2
   [1369] => 1
   [1370] => 5
   [24] => 20040920
   [25] => 
   [1119] => Y
   [440] => N
   [10] => 237466381
   [498] => 1041931
   [75] => LBS
   [4] => Rfm.com
   [5] => 420  Road
   [6] => NONE
   [7] => Wst Hn
   [8] => CT
   [9] => 00562
   [183] => 5555551212
   [68] => USD
   [116] => 2
   [1117] => 1
   [1400] => 2.0
   [1401] => 1.0
)

Manifest data, package #1:

Array
(
   [delivery_id] => 
   [orders_id] => 282
   [delivery_name] => Anthony DeSalvatore
   [delivery_company] => 
   [delivery_address_1] => 114 drive
   [delivery_address_2] => 
   [delivery_city] => atown
   [delivery_state] => PA
   [delivery_postcode] => 18104
   [delivery_phone] => 5555551212
   [package_value] => 400
   [oversized] => 0
   [pickup_date] => 20040920
   [shipping_type] => 05
   [residential] => N
   [cod] => 
   [multiple] => 1
   [package_weight] => 1.0
   [tracking_num] => master_trackNum
)

Shipment request data, package #2:

Array
(
   [0] => 21
   [16] => PA
   [13] => 114 drive
   [1273] => 01
   [1274] => 05
   [18] => 5555551212
   [15] => atown
   [23] => 01
   [117] => US
   [17] => 18104
   [50] => US
   [11] => 
   [12] => Anthony DeSalvatore
   [1333] => 1
   [1415] => 400.00
   [1368] => 2
   [1369] => 1
   [1370] => 5
   [24] => 20040920
   [25] => 
   [1119] => Y
   [440] => N
   [10] => 237466381
   [498] => 1041931
   [75] => LBS
   [4] => rf.com
   [5] => 420 Road
   [6] => NONE
   [7] => Wen
   [8] => CT
   [9] => 00252
   [183] => 5555551212
   [68] => USD
   [116] => 2
   [1117] => 2
   [1400] => 2.0
   [1401] => 1.0
   [1123] => master_trackNum
)

Manifest data, package #2:

Array
(
   [delivery_id] => 
   [orders_id] => 282
   [delivery_name] => Anthony DeSalvatore
   [delivery_company] => 
   [delivery_address_1] => 114 drive
   [delivery_address_2] => 
   [delivery_city] => atown
   [delivery_state] => PA
   [delivery_postcode] => 18104
   [delivery_phone] => 5555551212
   [package_value] => 400
   [oversized] => 0
   [pickup_date] => 20040920
   [shipping_type] => 05
   [residential] => N
   [cod] => 
   [multiple] => 2
   [package_weight] => 1.0
   [tracking_num] => trackNum
)

running in debug mode, no ship request made

 

Posted data looks o.k.... anyone else get this error, or have any ideas?

Share this post


Link to post
Share on other sites

Hello,

 

I have added this module and i am getting the following error when i attempt to ship a package:

 

ERROR: FedEx Return Error 1F30 : Recipient Phone must be 10 digits

 

Now, the only phone numbers i have in here are 10 digits. I have Real Time Quotes, it works, I have a meter number... Any idea how i can get past this and ship packages?

 

Thanks --

Share this post


Link to post
Share on other sites
Hello,

 

I have added this module and i am getting the following error when i attempt to ship a package:

 

ERROR: FedEx Return Error 1F30 : Recipient Phone must be 10 digits

 

Now, the only phone numbers i have in here are 10 digits. I have Real Time Quotes, it works, I have a meter number... Any idea how i can get past this and ship packages?

 

Thanks --

 

 

What format are your phone numbers in? Meaning: (123) 456 - 2569 or 123.456.2569 etc.

Share this post


Link to post
Share on other sites
If you could, switch to debug mode (option is at the top of ship_fedex.php) & post the output here.

 

Thanks -

 

Michael

Here's the output, altered for privacy purposes:

 

Shipment request data, package #1:

 

Array

(

[0] => 21

[16] => NV

[13] => 1234 Versailles Ct

[1273] => 01

[1274] => 92

[18] => 702 1234567

[15] => City

[23] => 01

[117] => US

[17] => 89999

[50] => US

[11] => Empro

[12] => John Smith

[1333] => 1

[1415] => 5.00

[1368] => 2

[1369] => 1

[1370] => 5

[24] => 20041004

[1119] => Y

[440] => N

[3124] => 2

[10] => 275692547

[498] => 3987654

[75] => LBS

[4] => www.websitename.com

[5] => 11222 NameOf Street

[6] => NONE

[7] => Las Vegas

[8] => NV

[9] => 89135

[183] => 7021234567

[68] => USD

[1401] => 4.0

)

 

Manifest data, package #1:

 

Array

(

[delivery_id] =>

[orders_id] => 766

[delivery_name] => John Smith

[delivery_company] =>

[delivery_address_1] => 1234 Versailles Ct

[delivery_address_2] =>

[delivery_city] => City

[delivery_state] => NV

[delivery_postcode] => 89074

[delivery_phone] => 702 123-4567

[package_weight] =>

[package_value] => 5

[oversized] => 2

[pickup_date] => 20041004

[shipping_type] => 92

[residential] => N

[cod] =>

[tracking_num] => master_trackNum

)

 

running in debug mode, no ship request made

 

That phone number format is not the same as what i have in the DB... which is interesting...

Share this post


Link to post
Share on other sites
[18] => 702 1234567

 

That phone number format is not the same as what i have in the DB... which is interesting...

 

Yeah - that's where the problem is, the space after the area code. What do you have for the number in the database?

Share this post


Link to post
Share on other sites
Yeah - that's where the problem is, the space after the area code. What do you have for the number in the database?

 

The number in the cutomers table is right, but the orders table has it wrong... will adjust now.

 

Ok, I adjusted it and now it works. Is it supposed to take me to the admin main login page and force me to login again after i ship an order? That was weird...

Share this post


Link to post
Share on other sites

Am I supposed to get sent to the admin main login page and forced to login again after i ship an order?

 

This also happens when I click the "Fedex label" button or the "cancel shipment" button. Any suggestions?

Share this post


Link to post
Share on other sites

I meant to say in my post above:

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

Am I supposed to get sent to the admin main login page and forced to login again after i ship an order?

 

This also happens when I click the "Fedex label" button, the "cancel shipment" button, or the "back" button -- the back button that appears on the "track shipment" page.

 

Any suggestions?

 

Thanks --

Share this post


Link to post
Share on other sites

I was added to the test server and I still get this error

 

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

 

ERROR: FedEx Return Error 5012 : Account number not in database

 

any ideas?? Im sure I just missed a step...but where?

Share this post


Link to post
Share on other sites
I was added to the test server and I still get this error

 

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

 

ERROR: FedEx Return Error 5012 : Account number not in database

 

any ideas?? Im sure I just missed a step...but where?

 

Which server to use is defined on line 3 of admin/includes/fedexdc.php; this needs to be set to "test."

 

Erm... otherwise, I'm not sure where to look. Check that and see what happens. You might also just have to wait a bit, or hassle fedex & make sure they're not pulling your chain...

Share this post


Link to post
Share on other sites
Which server to use is defined on line 3 of admin/includes/fedexdc.php; this needs to be set to "test."

 

Erm... otherwise, I'm not sure where to look. Check that and see what happens. You might also just have to wait a bit, or hassle fedex & make sure they're not pulling your chain...

 

Its defined as test, I read somthing about a subscription request...might that be it?

Share this post


Link to post
Share on other sites
I meant to say in my post above:

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

Am I supposed to get sent to the admin main login page and forced to login again after i ship an order?

 

This also happens when I click the "Fedex label" button, the "cancel shipment" button, or the "back" button -- the back button that appears on the "track shipment" page.

 

Any suggestions?

 

Thanks --

 

Bob -

 

Could you right-click on each of these buttons, "copy shortcut" or "copy link address", and paste the URL you get?

 

Thanks -

 

Michael

Share this post


Link to post
Share on other sites
Bob -

 

Could you right-click on each of these buttons, "copy shortcut" or "copy link address", and paste the URL you get?

 

Thanks -

 

Michael

 

Here you go:

 

fedex label button: https://sitename.server.com/~newcalsupplies...0004308&oID=766

 

cancel shipment button:

https://sitename.server.com/~newcalsupplies...40a1166dfc3f01d

 

back button on "track shipment" page:

https://sitename.server.com/~newcalsupplies...dfc3f01doID=766

Share this post


Link to post
Share on other sites

 

Bob -

 

In the first case, the fedex label, you're being sent back to the login page because the osCAdminID isn't being passed in the URL. This means that I've hard coded a URL somewhere, which I'll try to track down now...

 

Alright - replace line 434 (approximately - check for the // display the label comment) in order.php with:

 

   	 // display the label
  	 $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link('fedex_popup.php', 'oID=' .$oInfo->orders_id . '&num=' . $fedex_tracking) . '">' . tep_image_button('button_fedex_label.gif', IMAGE_ORDERS_FEDEX_LABEL) . '</a>');

 

That should only fix the label displaying page, but who knows? Maybe it'll have an impact elsewhere.

 

Michael

Share this post


Link to post
Share on other sites
Bob -

 

In the first case, the fedex label, you're being sent back to the login page because the osCAdminID isn't being passed in the URL. This means that I've hard coded a URL somewhere, which I'll try to track down now...

 

Alright - replace line 434 (approximately - check for the // display the label comment) in order.php with:

 

 ? ?	// display the label
? ?	$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link('fedex_popup.php', 'oID=' .$oInfo->orders_id . '&num=' . $fedex_tracking) . '">' . tep_image_button('button_fedex_label.gif', IMAGE_ORDERS_FEDEX_LABEL) . '</a>');

 

That should only fix the label displaying page, but who knows? Maybe it'll have an impact elsewhere.

 

Michael

 

Cool, we're getting there... the label does indeed work now, and when I clicked "cancel shipment" I got a popup asking if I was sure. I said OK, and was taken to the login page again. When I came back, the shipment had indeed been cancelled. All other instances of being dumped to the login page are still happening, though.

 

What should I look into next? Thanks --

Share this post


Link to post
Share on other sites
Cool, we're getting there... the label does indeed work now, and when I clicked "cancel shipment" I got a popup asking if I was sure. I said OK, and was taken to the login page again. When I came back, the shipment had indeed been cancelled. All other instances of being dumped to the login page are still happening, though.

 

What should I look into next? Thanks --

 

Bob -

 

Anytime you're getting dumped to the login page, it's because that osCAdminID isn't being passed in the URL. Usually this is because someone's hard-coded a URL, like I'd done; but for the "cancel" button, I expect there may be an issue where a that Javascript alert is screwing up the passing of the osCAdminID.

 

You might want to try deleting this portion of orders.php, line 440:

 

onClick="return(window.confirm(\'Cancel shipment of order number ' . $oInfo->orders_id . '?\'));"

 

...so that line would be:

 

   	 $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SHIP_FEDEX, 'oID=' .$oInfo->orders_id . '&num=' . $fedex_tracking . '&action=cancel&fedex_gateway=' . $fedex_gateway) . '">' . tep_image_button('button_cancel_shipment.gif', IMAGE_ORDERS_CANCEL_SHIPMENT) . '</a>');

 

I haven't tested this, but it should just let you cancel the order w/no warning.

 

If this works, I may have to redo the contribution w/o javascript warnings.

 

Michael

Share this post


Link to post
Share on other sites
Bob -

 

Anytime you're getting dumped to the login page, it's because that osCAdminID isn't being passed in the URL. Usually this is because someone's hard-coded a URL, like I'd done; but for the "cancel" button, I expect there may be an issue where a that Javascript alert is screwing up the passing of the osCAdminID.

 

You might want to try deleting this portion of orders.php, line 440:

 

onClick="return(window.confirm(\'Cancel shipment of order number ' . $oInfo->orders_id . '?\'));"

 

...so that line would be:

 

 ? ?	$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SHIP_FEDEX, 'oID=' .$oInfo->orders_id . '&num=' . $fedex_tracking . '&action=cancel&fedex_gateway=' . $fedex_gateway) . '">' . tep_image_button('button_cancel_shipment.gif', IMAGE_ORDERS_CANCEL_SHIPMENT) . '</a>');

 

I haven't tested this, but it should just let you cancel the order w/no warning.

 

If this works, I may have to redo the contribution w/o javascript warnings.

 

Michael

 

Yes, it does cancel the order with no warning... but it still spits me out at the login page. If I login, or back up with my browser's back button, I find that the ship request is cancelled.

 

You're right that the osCAdminID is not consistently being passed correctly. Would it help to add a hidden field in orders.php that contains that value as passed in from the URL? Something like:

 

<input type=\"hidden\" name=\"osCAdminID\" value=\"$_REQUEST['osCAdminID']\">

 

What about that?

Share this post


Link to post
Share on other sites
Yes, it does cancel the order with no warning... but it still spits me out at the login page. If I login, or back up with my browser's back button, I find that the ship request is cancelled.

 

You're right that the osCAdminID is not consistently being passed correctly. Would it help to add a hidden field in orders.php that contains that value as passed in from the URL? Something like:

 

<input type=\"hidden\" name=\"osCAdminID\" value=\"$_REQUEST['osCAdminID']\">

 

What about that?

 

Nope - that's what the tep_href_link() function does: it adds all the session-tracking values to the URL.

 

What I find strange about this business is that in the URLs you posted, only one - the "Fedex Label" one - was missing the osCAdminID, and that one's now fixed. Both the "cancel shipment" and the "track shipment" links include all the necessary information, & shouldn't be giving you any grief. At this point, all your urls should be correct, which should be enough to keep your session alive.

 

Though you say "You're right that the osCAdminID is not consistently being passed correctly." Is this still occurring? If so, on what links?

Share this post


Link to post
Share on other sites
Nope - that's what the tep_href_link() function does: it adds all the session-tracking values to the URL.

 

What I find strange about this business is that in the URLs you posted, only one - the "Fedex Label" one - was missing the osCAdminID, and that one's now fixed. Both the "cancel shipment" and the "track shipment" links include all the necessary information, & shouldn't be giving you any grief. At this point, all your urls should be correct, which should be enough to keep your session alive.

 

Though you say "You're right that the osCAdminID is not consistently being passed correctly." Is this still occurring? If so, on what links?

 

The "submit" button for shipping, when it passes me to the login page, the osCAdminID is a new one that is no longer correct. Same with "cancel shipment." The "back" button under "track shipment" actually does pass the right ID, but still coughs me out to the admin login page.

 

That's what I meant about it not being consistent. Sorry I wasn't more clear.

Share this post


Link to post
Share on other sites
Would it help if I paste in the code for the whole orders.php page?

 

No, probably not... not yet anyway. Have you done any other modifications to any administrative stuff? I'm trying to figure out why the oscadminid would change mid-session (I've posted to the general help forum to see if anyone else knows).

 

I don't know much about session management, but in my experience that oscadminid shows up on the index page, but doesn't show up in subsequent URLs - I think PHP just deals with the session, or something. I'm hoping to find some outside assistance to figure this one out.

 

Michael

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  

×