Page 1 of 1
USPS Display Delivery Time not working...
Posted: Tue Apr 20, 2010 4:49 am
by lildaveycross
I am using opencart 1.4.7, and so far everything is working great, except for the USPS Display Delivery Time is not working. I have it turned on as well as the Display Delivery Weight (which works fine), but I do not see the delivery time. Currently it looks like this
Priority Mail (Weight: 0.50lb)
First-Class Mail Parcel (Weight: 0.50lb)
It's not a BIG deal if the delivery times are there or not, but it would be nice if they were. Anyone else have this problem, and a possible solution?
thanks!
Re: USPS Display Delivery Time not working...
Posted: Tue Apr 20, 2010 10:13 am
by lildaveycross
Oh, forgot to mention that it displays fine with international shipping, just not domestic (US)...
Re: USPS Display Delivery Time not working...
Posted: Tue Apr 20, 2010 10:20 am
by Qphoria
I will try to have it fixed in the next version
Re: USPS Display Delivery Time not working...
Posted: Sat Jan 08, 2011 12:02 pm
by cruiz
Anyone find a fix for this USPS not showing delivery time??
Re: USPS Display Delivery Time not working...
Posted: Sun Jan 09, 2011 12:01 am
by Johnathan
My impression from reading the API was that domestically it only works for Express mail anyway. I handle it by manually adding in the time estimate (e.g. "Priority Mail (1-3 days)").
Re: USPS Display Delivery Time not working...
Posted: Sun Jan 09, 2011 12:53 am
by Qphoria
yea.. it is domestic only and their api only supports it with EXPRESS, PRIORITY, PARCEL, and FIRSTCLASS
Re: USPS Display Delivery Time not working...
Posted: Sun Jan 09, 2011 7:47 am
by cruiz
Johnathan wrote:My impression from reading the API was that domestically it only works for Express mail anyway. I handle it by manually adding in the time estimate (e.g. "Priority Mail (1-3 days)").
Which file did you edit to manually add in the entry??
Re: USPS Display Delivery Time not working...
Posted: Mon Jan 10, 2011 10:55 am
by Johnathan
The way I do it is like this:
IN:
REPLACE:
Code: Select all
$quote_data[$classid] = array(
'id' => 'usps.' . $classid,
'title' => $postage->getElementsByTagName('MailService')->item(0)->nodeValue,
WITH:
Code: Select all
$shipping_name = $postage->getElementsByTagName('MailService')->item(0)->nodeValue;
$shipping_name = str_replace('<sup>®</sup>', '', html_entity_decode($shipping_name));
if (strpos($shipping_name, '-Class')) $shipping_name = 'First-Class Mail';
if ($shipping_name == 'First-Class Mail') $shipping_name .= ' (1-3 days)';
elseif ($shipping_name == 'Parcel Post') $shipping_name .= ' (2-8 days)';
elseif ($shipping_name == 'Priority Mail') $shipping_name .= ' (1-3 days)';
elseif ($shipping_name == 'Express Mail') $shipping_name .= ' (1 day)';
$quote_data[$classid] = array(
'id' => 'usps.' . $classid,
'title' => $shipping_name,
Re: USPS Display Delivery Time not working...
Posted: Tue Jan 11, 2011 5:20 am
by cruiz
Thanks...worked great..
Re: USPS Display Delivery Time not working...
Posted: Fri Jan 14, 2011 7:49 am
by popsdaddy
Thanks for the code.
I had to use the following in order to get Priority Flat Rate Box and Envelope to work:
if (strpos($shipping_name, '-Class')) $shipping_name = 'First-Class Mail';
if ($shipping_name == 'First-Class Mail') $shipping_name .= ' (3-5 days)';
elseif ($shipping_name == 'Priority Mail Small Flat Rate Box') $shipping_name .= ' (1-3 days)';
elseif ($shipping_name == 'Priority Mail Flat Rate Envelope') $shipping_name .= ' (1-3 days)';
Re: USPS Display Delivery Time not working...
Posted: Mon Apr 15, 2013 10:26 am
by NoJoke
Does anyone happen to know how to get this to work in version 1.5.4.1?
Thanks
Re: USPS Display Delivery Time not working...
Posted: Mon Apr 15, 2013 2:21 pm
by Qphoria
NoJoke wrote:Does anyone happen to know how to get this to work in version 1.5.4.1?
Thanks
this was an issue back in 1.4.x
This is no longer an issue in 1.5.1 or later
However, I don't think the domestic rates include delivery dates in the code. That needs to be added in general. Should work for international rates tho.
Re: USPS Display Delivery Time not working...
Posted: Mon Apr 15, 2013 2:30 pm
by NoJoke
The domestic rates do not show the estimated delivery times that is why I was wondering if the code above has been altered by anyone to work in the version I have as I like to display an estimated delivery time to the customer
Re: USPS Display Delivery Time not working...
Posted: Mon Apr 15, 2013 11:25 pm
by Johnathan
Last I checked, the estimated delivery times are not returned from USPS for domestic rates. This could have changed in the last API update they did, but given how efficient USPS is, I doubt it.

Re: USPS Display Delivery Time not working...
Posted: Tue Apr 16, 2013 1:19 am
by NoJoke
No it is still the same as before...anyone happen to know what needs to be changed in that code above to get it to work in version 1.5.4.1? I know some of the values probably have changed
Re: USPS Display Delivery Time not working...
Posted: Wed Apr 17, 2013 7:50 am
by NoJoke
So do you know what changes need to be made to the above code that you gave for it to work in 1.5.4.1?
Thanks
Re: USPS Display Delivery Time not working...
Posted: Thu Apr 18, 2013 9:16 am
by Qphoria
I remember in my USPS mod back in 1.4.x... for whatever reason USPS domestic rates are in a different format than the international rates. You have to go through some additional hoops to get domestic rates so that is likely why daniel didn't add them to the core version. I'll look into again when I get a chance and see if I can port over what I had from my old usps mod
Re: USPS Display Delivery Time not working...
Posted: Thu Apr 18, 2013 10:03 am
by NoJoke
Ok..I just think it would be nice for the customers to be able to know an estimated time for certain Domestic Usps shippjng methods so I don't receive 100s of calls about it. Lol
Re: USPS Display Delivery Time not working...
Posted: Tue May 14, 2013 11:52 am
by NoJoke
Any new outlook on this? Just was wondering if what jonathan wrote up there can be modded to work in 1.5.4.1 so that way i can display the estimated time to the right of the priority mail option
Re: USPS Display Delivery Time not working...
Posted: Fri Aug 02, 2013 11:59 pm
by webauthorings
Two clients using V1.4.9.3 and v1.5.1.1.
Changed the following line to reflect the new wording:
elseif ($shipping_name == 'Priority Mail 2-Day') $shipping_name = 'Priority Mail (1-3 days)';
The lower version was showing "Priority Mail 1-Day" so that was changed accordingly.