Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automated FedEx Labels


spoot

Recommended Posts

Update! I have added to the contribution area a new "ship_fedex.php" file. In this file I have added Saturday Delivery, Package Dimensions, Hold At Location, Ground Shipping, Ground Shipping Auto Proof of Delivery.

 

I was approved by FedEx, so it should work just fine.

 

Enjoy!

 

Chris B.

 

Tried to use this new ship_fedex.php- on processing a shipment kept getting an error that stated "Dimension height must be numeric." I wasn't entering any dimensions, so I commented out everything that talked about dimensions in the file. Then I was getting the old "Package count" error I asked about a few posts earlier, so I switched to an order with only one package, and got this:

 

1054 - Unknown column 'saturday_delivery' in 'field list'

 

insert into shipping_manifest (delivery_id, orders_id, delivery_name, delivery_company, delivery_address_1, delivery_address_2, delivery_city, delivery_state, delivery_postcode, delivery_phone, package_weight, package_value, oversized, pickup_date, saturday_delivery, hold_at_location, hal_address, hal_city, hal_state, hal_postcode, hal_phone, dim_height, dim_width, dim_length, shipping_type, residential, autopod, cod, tracking_num) values ('', '189', 'Storefront Sales', '', 'XXXXXXXXX', '', 'XXXX', 'XX', 'XXXX2', 'XXXXXXXXX3', '', '', '0', '20051116', '0', '0', '', '', '', '', '', '', '', '', '03', 'N', '0', '', 'XXXXXXXXX')

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

  • Replies 713
  • Created
  • Last Reply

Top Posters In This Topic

Hi djmonkey,

 

I forgot to include the shipping_manifest changes along with the file. I'm sorry for the error:

1054 - Unknown column 'saturday_delivery' in 'field list'

 

However, when using the updated ship_fedex when you choose "Your Packaging" you must input dimensions into the area where it asks for it. Also, I only used the default measurement system which was inches. I was not able to do the metric.

 

Your second error unfortunately I still don't know what could cause that.

 

I have uploaded the new zip file to contain the changes to the shipping_manifest table in the database.

 

Please let me know if you have any more problems.

 

Chris B.

Link to comment
Share on other sites

Hi djmonkey,

 

I forgot to include the shipping_manifest changes along with the file. I'm sorry for the error:

However, when using the updated ship_fedex when you choose "Your Packaging" you must input dimensions into the area where it asks for it. Also, I only used the default measurement system which was inches. I was not able to do the metric.

 

Your second error unfortunately I still don't know what could cause that.

 

I have uploaded the new zip file to contain the changes to the shipping_manifest table in the database.

 

Please let me know if you have any more problems.

 

Chris B.

 

Do the dimensions work for multiple packages, ie, two boxes, two sizes, one recipient?

 

Thanks!

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Do the dimensions work for multiple packages, ie, two boxes, two sizes, one recipient?

 

Thanks!

 

No, I'm sorry I didn't put that into the code. I see what you're asking for though. Once you make all the regular selections, and hit the ship button, it takes you to the next screen where it asks you for the weight on the next boxes, that's where you would input the other box sizes. Hmm, I'm not sure when I can look into it, but I will keep you posted. It's definitely worth having...

 

Chris B.

Link to comment
Share on other sites

No, I'm sorry I didn't put that into the code. I see what you're asking for though. Once you make all the regular selections, and hit the ship button, it takes you to the next screen where it asks you for the weight on the next boxes, that's where you would input the other box sizes. Hmm, I'm not sure when I can look into it, but I will keep you posted. It's definitely worth having...

 

Chris B.

 

Yes, definitely- thanks for your help and for taking the time to put out this contribution.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Can anyone give me any suggestions for why the second address line is not making it onto the labels? Is anyone else having this problem? Could there be a syntax issue with the sql query or if this info just plain out not included?

 

If you have any ideas I would really appreciate them.

 

Thanks!!

 

Craig

Link to comment
Share on other sites

Check for this line in /admin/ship_fedex.php

 

around line 122 or so:

,13=>   $order_info['delivery_street_address'] // delivery address
,14=> $order_info['delivery_street_address_2'] // delivery address 2

 

and around line 720 or so:

		  <?php echo $order_info['delivery_street_address']; ?>
	  <?php
	  if ($order_info['delivery_street_address_2'] > '4') {
	   echo ('<br>??' . $order_info['delivery_street_address_2']);
	   } ?><br>?

 

When you installed the address 2 contrib/mod (assuming you did), the database should already have the necessary parameters and if address_2 is being captured in your orders the above should fix it, or at least help you find where it is getting lost....

Edited by DRIVE
Link to comment
Share on other sites

Thank you DRIVE!

 

I did not know there was an address2 mod, should I look for and install that before looking for what you said to look for (or is THAT the mod?)

 

Let me know and I will do what I need to do ..

 

I GREATLY appreciate your help!!

 

Craig

Link to comment
Share on other sites

Ok now I am confused. : )

 

Customers already can enter their second address line and it shows up in the orders page, it just does not make it to the label.

 

I guess this is making a little sense now, I think you were telling me earlier to uncomment that code to make it work .. I am not too bright.

 

I am using FedEx Automated Labels, yes.

 

I will check on that code. Correct me if you see that I am retarded again ..

 

Craig

Link to comment
Share on other sites

Should be good to go as long as you didnt do something wacky like use the "Suburb" slot for Address2.... some people have done that.

 

The true "Second Address Line" contrib changes the core of OSC so that it is properly integrated into the database and subsequently, is more easily available to be used by other modules and contribs....

 

Good luck!! :thumbsup:

Link to comment
Share on other sites

Ok just when I thought I had done well ...

 

I went to make the changes and realized that info was kept in the "suburb" field of the database so I changed the code to reflect that (and now it works, yay)

 

But .. what are you saying? This is wrong or bad?

 

I have CRE Loaded if that makes a difference ...

 

I appreciate ALL your help!!

 

Craig

Link to comment
Share on other sites

Uhhhhhh.... I guess it isnt "wrong" or "bad" if it works.... but it becomes bad when you have another module you want to use!! Its okay for a quck-fix but pigeon-holes you into a "hack".

 

Install the Second Address contrib and you'll be thankful for it. It does require a "moderate" skill level according to the author, but it is more tedious than anything. First time I installed it, I printed the whole thing out and went through line by line, section by section and marked off the stuff I had complete. If you do that, you should be okay. Or create an email draft and change your sections to red or something as you work along.

 

I dont know if there is a support thread for it or not

Link to comment
Share on other sites

More about the "Package Count" error:

 

First off, I use Multi Vendor Shipping, so this may contribute to the problem.

 

The main thing that I've noticed is that FedEx Automated Labels doesn't count packages. Under "Required Fields" the "Number of Packages" always says "1" regardless of how many items were purchased and how they would be packed going by the max weight of packages rule (which this contribution apparently ignores). For package weight, the total weight of all the products is added with the tare weight thrown in one time.

 

Processing a test order, I purchased 10 each of two different products from my store. I changed the number of packages to "10", adjusted the package weight to show the appropriate amount (in this case, 81 lbs), and hit submit.

 

On the next page I see this:

 

fedex_snapshot.jpg

Which, to me, is completely absurd. I haven't looked closely at the code yet but this seems like a weird way to cut up packages.

 

I change the individual package weights to each read "8.1" and hit submit, then see the error

 

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.

 

I've only seen this error when trying to ship 2 Day or Standard Overnight (basically the only shipping options I ever use). I processed this test order using Ground and it worked A-OK. Also, when I first used the contribution it worked fine. Maybe something has changed in the ship_fedex file with new updates that affects this? Or maybe it's something that has changed on the FedEx side?

 

For me this is a huge problem, and I'll be looking at it a lot in the next few weeks as I'll have the time. Hopefully we can come up with a solution for this.

 

Thanks,

Stew

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

I've hacked my way through and am slowly coming up with band-aid type solutions.

 

At around line 719 I'm using

 

<td class="main"><?php echo tep_draw_input_field('package_num',(int)($order_qty/2 + .5),'size="2"'); ?></td>

 

to define the number of packages. It's a hack but it works for me. I added .5 because using (int) causes the number to be rounded down. If anyone knows of how to do this and automatically round the number up I would greatly appreciate that information.

 

At around line 774 I'm using

 

<td class="main">
							 <?php 
							 $my_order_weight = (int)($order_qty * 3.5 + SHIPPING_BOX_WEIGHT * ((int)($order_qty/2 + .5)))
							 ?>

							 <?php echo tep_draw_input_field('package_weight',$my_order_weight,'size="4"'); 
							 ?></td>

 

to define the package weight. Once again it's a hack and I could use some help; this only returns whole numbers, and I would like it to return absolute values. If I take out the (int)s then the field appears blank on ship_fedex.php.

 

For the problem of the individual package weights not adding up, the offending code appears to be

 

						 if ($package_num > 1) {
						 echo '<tr>';
						 for ($i = 1; $i <= $package_num; $i++) {
							 echo '<td class="main" align="right">Package #' . $i . ' Weight:</td>';
							 echo '<td class="main"> </td>';
							 $item_weight_rounded = sprintf("%01.1f", array_pop($item_weights));
							 echo '<td class="main">' . tep_draw_input_field('package_' . $i . '_weight', $item_weight_rounded, 'size="2"') . '</td>';
							 $div = $i/3;
							 if (is_int($div) && ($i != $package_num)) {
								 echo '</tr><tr>';
								 }
							 }
						 echo '</tr>';
					 }

 

After researching what array_pop and sprintf are for, it seems to me that there might be a better way to do this. As it is, this doesn't take into account the weights of duplicate items, as in my example where I ordered 10 each of two different items. Shouldn't this number be based package_weight and package_num? It seems that for this application the easiest and most logical way to determine the weight of individual packages without coming up with a complicated algorithm would be to just divide the package weight by the number of packages.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

OK-

 

At line 895 I now have

 

$item_weight_rounded = sprintf("%01.1f", ($package_weight/$package_num));

 

to determine the individual package weights.

 

I don't know if that's really better than what's there already, but once again, it works for me. Maybe it will help out someone else too.

 

Stew

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Hi DJ Monkey,

 

The philosophy behind the enhancement was to speed up 90% of the transaction over the original code with minimum changes. (Pareto principle)

 

The quantity and weights will populate correctly if you had chosen different items. (I catered more to the reasoning that it was more likely for people to buy single items of different items than multiple items of the same thing) The logic to handle multiple item and weight is not added in. For example, if you order 2 * ItemA and 3 * ItemB and you decide to pack in 2 packages..the system does not put 2*Weight ItemA and 3 * WeightItemB coz it doesn't have that breakdown. All it knows at the moment is the original number of items and total weight. To handle that, you must put in more logic.

 

Sprintf is there to ensure formatting to 1 decimal place. It seems FedEx expects a decimal place precision...not even accepting an integer.

 

The package count error has always been there for Express shipments. It seems only to work for Ground shipment.

 

Hope this helps.

- The Jackal

Link to comment
Share on other sites

I called FedEx and asked about "ERROR: FedEx Return Error 1219 : Invalid package count or package sequence exceeds package count." when attempting to ship multi-piece shipments Two Day Air, and the guy I spoke with told me that it isn't availble using the Ship Manager API. It will only work when shipping Domestic Ground, Express International, or Express Domestic with COD.

 

Great.

 

He also says it's always been like that and they get people calling all the time asking about (you'd think they'd change it if they get that many phone calls about it).

 

Hi DJ Monkey,

 

The philosophy behind the enhancement was to speed up 90% of the transaction over the original code with minimum changes. (Pareto principle)

 

The quantity and weights will populate correctly if you had chosen different items. (I catered more to the reasoning that it was more likely for people to buy single items of different items than multiple items of the same thing) The logic to handle multiple item and weight is not added in. For example, if you order 2 * ItemA and 3 * ItemB and you decide to pack in 2 packages..the system does not put 2*Weight ItemA and 3 * WeightItemB coz it doesn't have that breakdown. All it knows at the moment is the original number of items and total weight. To handle that, you must put in more logic.

 

Sprintf is there to ensure formatting to 1 decimal place. It seems FedEx expects a decimal place precision...not even accepting an integer.

 

The package count error has always been there for Express shipments. It seems only to work for Ground shipment.

 

Hope this helps.

 

Thanks Jackal- I ended up using sprintf in a couple places once I appreciated it's value. Now if only I could process multi-piece shipments using Express methods. Maybe I'll call my UPS rep.....

Edited by djmonkey1

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

My Fedex automated labels work perfect except:

 

Under the barcode, where the tracking number is---

the first set of numbers generate, but the next two sets of numbers are all 0's! No tracking number! What causes this? I accidentally shipped my first package this way and I don't know if it actually went out or not, I won't know because I don't have the tracking number! (If they actually put on a good bar code for me)

Link to comment
Share on other sites

Hi djmonkey,

 

I forgot to include the shipping_manifest changes along with the file. I'm sorry for the error:

 

 

However, when using the updated ship_fedex when you choose "Your Packaging" you must input dimensions into the area where it asks for it. Also, I only used the default measurement system which was inches. I was not able to do the metric.

 

Your second error unfortunately I still don't know what could cause that.

 

I have uploaded the new zip file to contain the changes to the shipping_manifest table in the database.

 

Please let me know if you have any more problems.

 

Chris B.

 

Chris-

 

I've gone back to this version of ship_fedex.php, and with a few tweaks of my own it's working very well for me. The ability to input the package dimensions and also choose Saturday Delivery are huge improvements.

 

For the input of different dimensions for each package, couldn't you do it the same way that package weight is handled?

 

I'm thinking about modifying the code found at about line 1152 to look something like this:

 

<?php
					 if ($package_num > 1) {
						 echo '<tr>';
						 for ($i = 1; $i <= $package_num; $i++) {
							 echo '<td class="main" align="right">Package #' . $i . ' Weight:</td>';
							 echo '<td class="main"> </td>';
							 $item_weight_rounded = sprintf("%01.1f", ($package_weight/$package_num));
							 echo '<td class="main">' . tep_draw_input_field('package_' . $i . '_weight', $item_weight_rounded, 'size="2"') . '</td>';
echo '</tr><tr>';
 echo '<td class="main" align="right">Package #' . $i . ' Height:</td>';
							 echo '<td class="main"> </td>';

							 echo '<td class="main">' . tep_draw_input_field('package_' . $i . '_height', '', 'size="2"') . '</td>';
 echo '</tr><tr>';
 echo '<td class="main" align="right">Package #' . $i . ' Width:</td>';
							 echo '<td class="main"> </td>';

							 echo '<td class="main">' . tep_draw_input_field('package_' . $i . '_width', '', 'size="2"') . '</td>';
 echo '</tr><tr>';
 echo '<td class="main" align="right">Package #' . $i . ' Length:</td>';
							 echo '<td class="main"> </td>';

							 echo '<td class="main">' . tep_draw_input_field('package_' . $i . '_length', '', 'size="2"') . '</td>';
							 $div = $i/3;
							 if (is_int($div) && ($i != $package_num)) {
								 echo '</tr><tr>';
								 }
							 }
						 echo '</tr>';
					 }
?>

 

This wouldn't work if used exactly like this, I don't think, and there's at least one other small mod that would also have to be made to the code, but you can see what I'm getting at.

 

Stew

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

I know probably I should ask this question under the Fedex realtime quotes thread but I noticed that thread is not quite up to date. I know there are some experts here on this topic so I'm posting it here.

 

We mainly ship to residential addresses so we just enabled Fedex home delivery option (disabled the ground). Some of my customers have home based business so they put their business name in the Company name field. But when there is a company name in a customer's profile, Fedex automatically sets the delivery option to ground which is disabled in our system. So these customers don't see this option at all. They have to choose UPS ground option which is more expensive than Fedex.

 

Here is the dilemma. We want to keep the company field to better know our customers but we also want them to be able to choose Fedex home delivery option.

 

I like to know if anyone here is having the same problem and what's the best way to solve this problem. My guess is that if the cart doesn't pass company name field to Fedex server then Fedex would treat the address a residential address and therefore show the home delivery option. But I'm not a programmer so I don't know where to change the code.

 

Thanks in advance.

 

Wendy

Link to comment
Share on other sites

I know probably I should ask this question under the Fedex realtime quotes thread but I noticed that thread is not quite up to date. I know there are some experts here on this topic so I'm posting it here.

 

We mainly ship to residential addresses so we just enabled Fedex home delivery option (disabled the ground). Some of my customers have home based business so they put their business name in the Company name field. But when there is a company name in a customer's profile, Fedex automatically sets the delivery option to ground which is disabled in our system. So these customers don't see this option at all. They have to choose UPS ground option which is more expensive than Fedex.

 

Here is the dilemma. We want to keep the company field to better know our customers but we also want them to be able to choose Fedex home delivery option.

 

I like to know if anyone here is having the same problem and what's the best way to solve this problem. My guess is that if the cart doesn't pass company name field to Fedex server then Fedex would treat the address a residential address and therefore show the home delivery option. But I'm not a programmer so I don't know where to change the code.

 

Thanks in advance.

 

Wendy

 

Why not just enable Ground?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

The ground shipping rate is different from home delivery I think. It is indeed cheaper. This means we will lose money on shipment with ground delivery. :(

 

Wendy

 

Yes, but if you enable both home delivery and ground, no one is ever quoted both, at least that's not what I see on my site. If there's a company name included they get quoted for Ground, if not they get quoted for Home Delivery.

 

If they pay for Ground, ship it Ground. If they pay for Home Delivery, ship it Home Delivery.

 

There's always going to be a fudge factor or gray area involved, where some shipments cost more than you charge and some cost less. In the event that you are concerned about losing money, or find that you are losing money, add in a handling fee. My fee is up to $3.00 per box to cover for FedEx's strange irregularities (do a line by line analysis of what you quoted for FedEx and what FedEx charged you: I have found that it is almost never the same), although all my FedEx shipments go out by Express methods, so your fee will likely not have to be so high.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Thanks for your reply.

 

You're right that they will only see one ground/home delivery quote. But the problem is that shipping address for customers with company names is residential address. So they're charged for ground shipping but I will be charged for home delivery by Fedex.

 

I just did a test. A shipment is quoted $11.03 for ground shipping and $13.38 for home shipping. So that's a quite hefty $$ burden on me.

 

If I can't find a perfect solution to this problem, I may have to find out the percentage of these cases and then add some surcharge to all Fedex shipments to break even.

 

I do remember though on some website they put an option there for customers to choose if the shipping address is residential or commercial. Then a corresponding shipping quote is displayed. Don't know if this can be added on this Fedex shipping mod.

 

Anyway, thanks so much for your help.

 

Wendy

Yes, but if you enable both home delivery and ground, no one is ever quoted both, at least that's not what I see on my site. If there's a company name included they get quoted for Ground, if not they get quoted for Home Delivery.

 

If they pay for Ground, ship it Ground. If they pay for Home Delivery, ship it Home Delivery.

 

There's always going to be a fudge factor or gray area involved, where some shipments cost more than you charge and some cost less. In the event that you are concerned about losing money, or find that you are losing money, add in a handling fee. My fee is up to $3.00 per box to cover for FedEx's strange irregularities (do a line by line analysis of what you quoted for FedEx and what FedEx charged you: I have found that it is almost never the same), although all my FedEx shipments go out by Express methods, so your fee will likely not have to be so high.

:( :( :(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...