Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Heads Up: July 28, 2013 USPS Name Change for Express Mail


krdito

Recommended Posts

How am I supposed to know what USPS entries are supposed to be in my configuration table and which ones were supposed to be removed. Why is everything being done for methods 5.2. What about those who moved to 6.1? How do I go back to 5.2 from 6.1 so I can get usps working again. Has no one come up with a USPS shipping module that truly works? Right now, I can't do USPS. It is dead in the water with methods 6.1 I am not sure what I need to the general.php files to go back to 5.2.2. Please do not assume we are all experienced coders.

Jim

Link to comment
Share on other sites

Perhaps someone in this forum can help me with this.

 

I was able to Uninstall the USPS Methods Module (5.2.0 - which was working properly prior to the recent USPS updates - probably because we do not use all the shipping options) and uploaded the two new files found in http://addons.oscommerce.com/info/487. For the most part the new USPS Methods Module (5.2.2) appears to be working properly again, with two exceptions. Neither the "Processing Time" nor the "Domestic Handling Fees" are adding these additions to the USPS responses for delivery date and shipping cost. I have reloaded the module's settings exactly as they were before the update, but no matter what numbers are included in either field, only the USPS amounts are returned.

 

Any idea what I need to change in order to get the additions to delivery time and shipping cost working again?

 

Thanks...

GEORGE

 

By anyones definition, I am not a php expert. However, I discovered that the shipdate being handed to USPS was the current date. I made the following change in the code to handle the 1 day or 2 day if Saturday to handle my 1 day processing requirement and it seems to be working. My guess is that there is a better way to do this, but I needed to get my store producing the correct info. I don't add a handling fee so I didn't research that. However, I don't see in the $request where a handling fee is being passed to the USPS. If it were me, I would just add the fee to the rates that I got back.

 

// VJW - Make the shipping date
// Calculate tomorrow's date
	 $tomorrow = mktime(0, 0, 0, date("m"), date("d")+1, date("Y"));
	 $dow = date('w',$tomorrow);
// if tomorrow is Sunday, add 2 days instead of 1
	 if ($dow == 0)
		 {
			 $tomorrow = mktime(0, 0, 0, date("m"), date("d")+2, date("Y"));
		 }
	 $shipDate = date('d-M-Y',$tomorrow);
// VJW - substituted shipdate for date in <shipDate>
$request .=
 '<Package ID="' . $services_count . '">' .
 '<Service>' . $key . '</Service>' .
 '<FirstClassMailType>' . $this->FirstClassMailType . '</FirstClassMailType>' .
 '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .
 '<ZipDestination>' . $dest_zip . '</ZipDestination>' .
 '<Pounds>' . $this->pounds . '</Pounds>' .
 '<Ounces>' . $this->ounces . '</Ounces>' .
 '<Container>' . $this->container . '</Container>' .
 '<Size>' . $this->size . '</Size>' .
 '<Value>' . $insurable . '</Value>' .
 '<Machinable>' . $this->machinable . '</Machinable>' .
 '<ShipDate>' . $shipDate . '</ShipDate>' .	
//	 '<ShipDate>' . date('d-M-Y') . '</ShipDate>' .
 '</Package>';

-- A ship in a harbor is safe, but that is not a ships ultimate purpose.

Link to comment
Share on other sites

@@vjwebb

I have discovered (by accident) that USPS returns the same data if the date field is blank. So you should be able to do

 

        '<ShipDate></ShipDate>' .     

 

Otherwise I suspect that your code will fail when the date it produces is a holiday.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@vjwebb

@@kymation

 

Thanks for your feedback. I'm not a php coder either, but would something like this work? I'm not really sure of the syntax to add the USPS_PROCESSING setup field but...

 

$tomorrow = mktime(0, 0, 0, date("m"), date("d")+USPS_PROCESSING, date("Y"));

 

I would like to get back to the ability to add the ship delay variable provided in the USPS Methods setup to the projected delivery date provided by USPS. This seemed to be working correctly before the recent update, but fails now.

 

Thanks...

GEORGE

Link to comment
Share on other sites

I took a moment to look over the 5.2.0 code missing in the new 5.2.2

 

  $request .=
  '<Package ID="' . $services_count . '">' .
  '<Service>' . $key . '</Service>' .
  '<FirstClassMailType>' . $this->FirstClassMailType . '</FirstClassMailType>' .
  '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .
  '<ZipDestination>' . $dest_zip . '</ZipDestination>' .
  '<Pounds>' . $this->pounds . '</Pounds>' .
  '<Ounces>' . $this->ounces . '</Ounces>' .
  '<Container>' . $this->container . '</Container>' .
  '<Size>' . $this->size . '</Size>' .
  '<Value>' . $insurable . '</Value>' .
  '<Machinable>' . $this->machinable . '</Machinable>';
  //'<ShipDate>' . $shipdate . '</ShipDate>' .
  $DP= explode(", ", MODULE_SHIPPING_USPS_PROCESSING);
  $shipdate =  date("d-M-Y", strtotime("+$DP[0] days"));
  $request .=
  '<ShipDate>' . $shipdate . '</ShipDate>' .
  '</Package>';

 

Would this syntax still work with 5.2.2?

 

Thanks...

GEORGE

Link to comment
Share on other sites

USPS does not currently return an expected delivery date. What they do now is embed a time-in-transit string in the name of the service. That looks like this:

 

Priority Mail 2-Day<sup>â„¢</sup> Small Flat Rate Box

 

It is possible to strip that out of the data, add your processing delay, and calculate the expected delivery date. Then you have to deal with the services that have no transit time available, such as Standard Post, First class, etc. Sounds like a lot of work.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Jim - thanks for your input. But for what it's worth I modified the code slightly as follows and replaced '<ShipDate>' . date('d,M,Y') . '</ShipDate>' with '<ShipDate>' . $shipdate . '</ShipDate>' .

 

// Define Shipping Delay
$DP= explode(", ", MODULE_SHIPPING_USPS_PROCESSING);
$shipdate = date("d-M-Y", strtotime("+$DP[0] days"));
// End Define Shipping Delay
$request .=
	 '<Package ID="' . $services_count . '">' .
	 '<Service>' . $key . '</Service>' .
	 '<FirstClassMailType>' . $this->FirstClassMailType . '</FirstClassMailType>' .
	 '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .
	 '<ZipDestination>' . $dest_zip . '</ZipDestination>' .
	 '<Pounds>' . $this->pounds . '</Pounds>' .
	 '<Ounces>' . $this->ounces . '</Ounces>' .
	 '<Container>' . $this->container . '</Container>' .
	 '<Size>' . $this->size . '</Size>' .
	 '<Value>' . $insurable . '</Value>' .
	 '<Machinable>' . $this->machinable . '</Machinable>';
	 '<ShipDate>' . $shipdate . '</ShipDate>' .
	 '</Package>';

 

 

What is now being returned is the following:

 

Priority Mail --- Approx. delivery time 2013-08-09 $5.80

 

Originally, USPS was returning 2013-08-07 as the delivery date (one day due to being in the same city). The modified code seems to be correctly added the 2 days processing time I had set in the USPS Methods SetUp variables.

 

Is this behaving the way it should? Or Is there something else I need to address here?

 

Thanks...

GEORGE

Edited by GPMaina
Link to comment
Share on other sites

How am I supposed to know what USPS entries are supposed to be in my configuration table and which ones were supposed to be removed. Why is everything being done for methods 5.2. What about those who moved to 6.1? How do I go back to 5.2 from 6.1 so I can get usps working again. Has no one come up with a USPS shipping module that truly works? Right now, I can't do USPS. It is dead in the water with methods 6.1 I am not sure what I need to the general.php files to go back to 5.2.2. Please do not assume we are all experienced coders.

Jim

 

If you clicked uninstall, then you search the configuration table for USPS and see entries.. all should be removed .. only one should be edited:

Installed Modules >> MODULE_SHIPPING_INSTALLED >> usps.php;zones.php;table3.php 

that one you will EDIT and just remove the usps.php with the semi-colon: usps.php;

 

 

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

I hard coded in a 3.5% handling fee until this module is fixed correctly.

 

includes > modules > shipping > usps.php

Around line 415

 

//'cost' => ($cost + $handling_cost[0]) * $shipping_num_boxes);
'cost' => ($cost+($cost*.035)));

Edited by mhulbrock
Link to comment
Share on other sites

And I can't get "Priority Mail Express tradmrk" to show (shows blank w/rate; even when selected, it revers back to Priority. (The express flat rate envelope does show, however)

 

Internationally, Express does show.

Link to comment
Share on other sites

And I can't get "Priority Mail Express tradmrk" to show (shows blank w/rate; even when selected, it revers back to Priority. (The express flat rate envelope does show, however)

 

Internationally, Express does show.

 

PS: it looks like when I select domestic first class as a shipping option, it shows the empty express. Yet first class does not show at all. Odd.

Link to comment
Share on other sites

Help please. I have OSC 2.3.3 installed. How do I tell which version of USPS I have installed so I can update as required?

 

This is the comments in the USPS file. Does not show a version.

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2008 osCommerce

 

Released under the GNU General Public License

 

Based on USPS Methods 26-Feb-2010

http://addons.oscommerce.com/info/487

*/

 

Should I install 5.2 or 6.1 version?

Link to comment
Share on other sites

Ok, so I stepped through the updates (v 6.x) for USPS Methods, including the USPS Methods 6.1c modified for osc 2.3. Works a treat... for that part.

 

It seems that with all the shenanigans I had to go through to get my shipping rates issue fixed has now managed to fubar my payment module (PayPal Express Checkout and PayPal Website Payments Standard).

 

Pointers on where I should look to get this fixed?

 

Thanks,

 

Judith

Link to comment
Share on other sites

@@mhulbrock - thanks for your suggestion for a quick fix to adding a handling charge to the rate quote. Generally, I am not in favor of hard-coded variables, since the quick-fix can generally cause long-term issues. But until the USPS Methods module settles down, your solution is expedient. I did make one change, however, because I use a fixed amount rather than a percentage calculation. But it works just as well.

 

includes > modules > shipping > usps.php

Around line 415

 

//'cost' => ($cost + $handling_cost[0]) * $shipping_num_boxes);
'cost' => ($cost + 1) * $shipping_num_boxes);

 

This adds $1 to the shipping cost as a handling charge. The deficiency is that the USPS Methods Module variables for shipping type as set in the Admin panel are still not being employed.

 

I can't find anywhere where the '$handling_cost' variable is being set - which may be why the original formula fails to calculate correctly.

 

Does anyone have any ideas on how to employ the handling charges that are set in the module Admin panel?

 

Thanks...

GEORGE

Link to comment
Share on other sites

Trying to update my client's USPS shipping module, so far I uninstalled old module (after backing up settings), uploaded new July fix, re-installed via admin panel.

 

Now I'm getting an error when logged into the administration panel. In Modules > Shipping I get "MODULE_SHIPPING_USPS_TEXT_TITLE" instead of USPS. It also wiped out all the buttons for the other shipping modules.

 

I already had all the DEETH updates in the general.php files. I removed extra entries in the database for USPS, edited out the line about the modules.

 

This setup was a bit different. Client had two usps.php files installed (usps.php and usps2.php). He sends to APO addresses, and must have needed a separate, duplicated module. Neither are showing presently.

 

Any hints on where to start? It seems to have wiped out the ability to add items to the cart at all at this point. Strictly made those changes above.

Link to comment
Share on other sites

Any hints on where to start? It seems to have wiped out the ability to add items to the cart at all at this point. Strictly made those changes above.

 

 

I know how frustrating it can be; I lost sleep because of this. Well I found this webpage and as old as it may be offered the solution that I applied to my website and it miraculously worked. I hope it gives you an insight of the pre-requisites before applying the July USPS.PHP change.

 

http://indiestechtips.wordpress.com/2011/03/07/usps-5-1-0-shipping-method-with-oscommerce/

 

Basically:

  • I updated the the GENERAL.PHP (both Catalog and Admin)
  • I Update MODULES.PHP on the Admin side
  • I removed remnants of old USPS modules in myphpadmin (database)
  • I Uninstalled the old USPS.PHP on my site and Installed the new one as of July 28 2013
  • I refreshed and it began to work. I could not edit my ADMIN USPS.PHP previously but was able to do so after updating my GENERAL.PHP and MODULE.PHP correctly

I hope this helps. Just be patient with this thing.

Edited by Holistic
Link to comment
Share on other sites

Start with the support thread for the module you're using. Both of the common modules have patches available. Otherwise I have no idea which USPS module you're talking about.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Just uploaded 5.3.0:

- fixed handling rates not being added

- fixed processing time not being added to estimates

- added field to specify delivery times in lieu of estimate provided by USPS

 

http://addons.oscommerce.com/info/487

 

Let me know if there are any issues. Also feel free to contribute / watch on github:

https://github.com/Evan-R/USPS-osCommerce

 

Cheers,

Link to comment
Share on other sites

Even... dang it.. that won't fix USPS Rate V4, Intl Rate V2, but it might just fix my clients osC v2.5.. but before I get there.. looking at the file differences.. I see you made use of "print_r" - I assume to see the TURE output.. I was just told about that but didn't know where or how.. so I assume you uncomment those lines and directly call the usps.php module file??

 

Looking thru your version indeed it looks like you plopped in the handling charges in all the appropriate places..

 

 

BUT it also appears the files does NOT have the ending ?> Can you verify that?

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

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...