Page 1 of 4
Changes to USPS Service
Posted: Wed Jul 17, 2013 4:15 am
by NoJoke
As I have heard and read about, on the 28th of this month there are going to be some changes regarding USPS, is there anything that we have to change for that module on our sites so we can be sure that we are displaying the correct shipping options and prices? Or is that information pulled directly and will change on its own when those new services are implemented?
article to information about the changes on july 28th can be found here :
https://liteblue.usps.gov/news/link/201 ... ws16s4.htm
Also
https://www.usps.com/business/web-tools ... elcome.htm
Re: Changes to USPS Service
Posted: Sun Jul 28, 2013 7:23 pm
by rotaryracer
Just did a test order on my cart and it looks like the new names with superscript "TM" and "R" aren't playing completely nice with OpenCart:
United States Postal Service
Priority Mail 1-Day<sup>™</sup>
$11.10
Standard Post<sup>®</sup>
$11.10
Anyone have any thoughts on how to either edit the appropriate code to make the superscript code work, or just remove it completely? The <sup> is a little goofy looking.
Thanks!
Jason
Re: Changes to USPS Service
Posted: Mon Jul 29, 2013 2:25 am
by BionicBill
I am seeing the same on new orders "Priority Mail 2-Day<sup>™</sup>" There should also be Priority 3 Day I think. Looks like a update is very much needed.
Just did some testing and found that First-Class Mail Parcel is not working.
I am running 1.5.4.1 OC
Re: Changes to USPS Service
Posted: Mon Jul 29, 2013 8:35 am
by BionicBill
Fix done
In: catalog/model/shipping/usps.php
Find:
Code: Select all
$result = str_replace('<sup>&reg;</sup>', '', $result);
$result = str_replace('<sup>&trade;</sup>', '', $result);
Replace with this:
Code: Select all
$result = str_replace('<sup>®</sup>', '', $result);
$result = str_replace('<sup>™</sup>', '', $result);
I have tested this on 1.5.4.1 and it also fixes First Class Mail which was not come up.
Note Priority Mail is Now displayed as Priority Mail 1-Day, Priority 2-Day or Priority 3-Day
I have not tested it yet but if you what to add the symbols they add for trademark I think this would work
Code: Select all
$result = str_replace('<sup>®</sup>', '<sup>®</sup>', $result);
$result = str_replace('<sup>™</sup>', '<sup>™</sup>', $result);
Re: Changes to USPS Service
Posted: Mon Jul 29, 2013 12:36 pm
by cwswebdesign
BionicBill wrote:Fix done
In: catalog/model/shipping/usps.php
Find:
Code: Select all
$result = str_replace('<sup>&reg;</sup>', '', $result);
$result = str_replace('<sup>&trade;</sup>', '', $result);
Replace with this:
Code: Select all
$result = str_replace('<sup>®</sup>', '', $result);
$result = str_replace('<sup>™</sup>', '', $result);
I have tested this on 1.5.4.1 and it also fixes First Class Mail which was not come up.
Note Priority Mail is Now displayed as Priority Mail 1-Day, Priority 2-Day or Priority 3-Day
I have not tested it yet but if you what to add the symbols they add for trademark I think this would work
Code: Select all
$result = str_replace('<sup>®</sup>', '<sup>®</sup>', $result);
$result = str_replace('<sup>™</sup>', '<sup>™</sup>', $result);
Also if doing the above I think you also need to replace the following code
Find:
Code: Select all
$firstclasses = array (
'First-Class Mail Parcel',
'First-Class Mail Large Envelope',
'First-Class Mail Letter',
'First-Class Mail Postcards'
);
Replace with:
Code: Select all
$firstclasses = array (
'First-Class Mail<sup>&174</sup> Parcel',
'First-Class Mail<sup>&174</sup> Large Envelope',
'First-Class Mail<sup>&174</sup> Letter',
'First-Class Mail<sup>&174</sup> Postcards'
);
Like I said I have not tested these changes to add the TM symbols.
I just tested the first fix with 1.5.5.1 and it works. Thank you!
DL
Re: Changes to USPS Service
Posted: Mon Jul 29, 2013 6:21 pm
by rotaryracer
Works like a champ on 1.5.4 - thanks very much for the quick fix!
Re: Changes to USPS Service
Posted: Mon Jul 29, 2013 9:49 pm
by bluebikerboy2
will these fixes work in 1.5.2.1?
Re: Changes to USPS Service
Posted: Mon Jul 29, 2013 10:05 pm
by Qphoria
Yes they should work as far back as 1.5.1.3 i believe
Re: Changes to USPS Service
Posted: Mon Jul 29, 2013 10:58 pm
by BionicBill
I have also updated the language file usps.php under admin/language/english/shipping/usps.php to update the new names for shipping services.
Should work for 1.5.X but backup before trying.
Re: Changes to USPS Service
Posted: Tue Jul 30, 2013 1:39 am
by lorodoes
It appears that the First class mail fix didnt't work. I just tried it on 1.5.5.1 and I am still not getting any of the first-class mail options when going checking out.
Re: Changes to USPS Service
Posted: Tue Jul 30, 2013 2:22 am
by lorodoes
BionicBill wrote:I have also updated the language file usps.php under admin/language/english/shipping/usps.php to update the new names for shipping services.
Should work for 1.5.X but backup before trying.
There are only 3 lines in that file, but there are more than that in the file on my system.
Re: Changes to USPS Service
Posted: Tue Jul 30, 2013 2:48 am
by lorodoes
I found my problem
Code: Select all
$firstclasses = array (
'First-Class Mail Parcel',
'First-Class Mail Large Envelope',
'First-Class Mail Letter',
'First-Class Mail Postcards'
);
Is correct. The code that was provided by Bill for that section doesn't work.
Re: Changes to USPS Service
Posted: Tue Jul 30, 2013 2:55 am
by lorodoes
Nevermind I see what I did. DOH. Sorry guys. The replace is on the XML that is returned. and the array checks that xml for those matches. and again DOH.
Re: Changes to USPS Service
Posted: Tue Jul 30, 2013 3:00 am
by nealero
this seems to have fixed the <sup> issue but we offer two shipping options
Priority Mail Express 1-Day Flat Rate Envelope
Priority Mail 1-Day
Is there a way to change the names that are displayed so that it reads
Express Mail 1-2 Day
Priority Mail 2-3 Day

?
Re: Changes to USPS Service
Posted: Tue Jul 30, 2013 5:19 am
by thohell
I have the same issue as nealero. It fixed it so now that it works properly, but it's not displaying priority mail 1-day. Is there any way to remove the 1-day?
Thanks,
James
Re: Changes to USPS Service
Posted: Tue Jul 30, 2013 5:59 am
by richdtt
nealero wrote:this seems to have fixed the <sup> issue but we offer two shipping options
Priority Mail Express 1-Day Flat Rate Envelope
Priority Mail 1-Day
Is there a way to change the names that are displayed so that it reads
Express Mail 1-2 Day
Priority Mail 2-3 Day

?
try adding
$result = str_replace('Priority Mail Express 1-Day Flat Rate Envelope', 'Express Mail 1-2 Day ', $result);
$result = str_replace('Priority Mail 1-Day', 'Priority Mail 2-3 Day', $result);
Re: Changes to USPS Service
Posted: Tue Jul 30, 2013 12:19 pm
by Sidecutter
Does anyone know if the fixes given above will work for older versions? Specifically, 1.4.9.6 in my case. I'm getting the same issues with the new changes the USPS made on the 28th.
Re: Changes to USPS Service
Posted: Tue Jul 30, 2013 10:20 pm
by promofire
I also need to know how to fix it in 1.4.9.3
Thanks
Re: Changes to USPS Service
Posted: Wed Jul 31, 2013 12:48 am
by webauthorings
Hey guys.
Not working on Version 1.4.9.3 or 1.5.1.1.
Thoughts?
Re: Changes to USPS Service
Posted: Wed Jul 31, 2013 3:43 am
by bclark856
Same for a client using 1.4.9.5. Need a fix for this. I spent an hour and a half digging through code this morning and came up empty