Post by lildaveycross » Tue Apr 20, 2010 4:49 am

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!
Last edited by i2Paq on Sat Jan 08, 2011 4:18 pm, edited 1 time in total.
Reason: Topic moved

Newbie

Posts

Joined
Tue Nov 11, 2008 5:36 am

Post by lildaveycross » Tue Apr 20, 2010 10:13 am

Oh, forgot to mention that it displays fine with international shipping, just not domestic (US)...

Newbie

Posts

Joined
Tue Nov 11, 2008 5:36 am

Post by Qphoria » Tue Apr 20, 2010 10:20 am

I will try to have it fixed in the next version

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by cruiz » Sat Jan 08, 2011 12:02 pm

Anyone find a fix for this USPS not showing delivery time??

New member

Posts

Joined
Thu Dec 09, 2010 4:11 am

Post by Johnathan » Sun Jan 09, 2011 12:01 am

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

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Qphoria » Sun Jan 09, 2011 12:53 am

yea.. it is domestic only and their api only supports it with EXPRESS, PRIORITY, PARCEL, and FIRSTCLASS

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by cruiz » Sun Jan 09, 2011 7:47 am

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

New member

Posts

Joined
Thu Dec 09, 2010 4:11 am

Post by Johnathan » Mon Jan 10, 2011 10:55 am

The way I do it is like this:

IN:

Code: Select all

/catalog/model/shipping/usps.php
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>&reg;</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, 

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by cruiz » Tue Jan 11, 2011 5:20 am

Thanks...worked great..

New member

Posts

Joined
Thu Dec 09, 2010 4:11 am

Post by popsdaddy » Fri Jan 14, 2011 7:49 am

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)';

Newbie

Posts

Joined
Fri Jan 07, 2011 1:35 am

Post by NoJoke » Mon Apr 15, 2013 10:26 am

Does anyone happen to know how to get this to work in version 1.5.4.1?

Thanks

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by Qphoria » Mon Apr 15, 2013 2:21 pm

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.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by NoJoke » Mon Apr 15, 2013 2:30 pm

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

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by Johnathan » Mon Apr 15, 2013 11:25 pm

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

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by NoJoke » Tue Apr 16, 2013 1:19 am

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

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by NoJoke » Wed Apr 17, 2013 7:50 am

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

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by Qphoria » Thu Apr 18, 2013 9:16 am

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by NoJoke » Thu Apr 18, 2013 10:03 am

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

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by NoJoke » Tue May 14, 2013 11:52 am

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

Active Member

Posts

Joined
Fri Oct 14, 2011 5:37 am

Post by webauthorings » Fri Aug 02, 2013 11:59 pm

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.

Regards,
Howard Baltus
WebAuthoring.com
TheTrickery.com


User avatar
Newbie

Posts

Joined
Fri May 27, 2011 10:31 pm
Who is online

Users browsing this forum: No registered users and 11 guests