Author Topic: USPS changed its mail service names  (Read 4582 times)

mbrando

  • Jr. Member
  • **
  • Posts: 68
    • www.JIKOmetrix.net
USPS changed its mail service names
« on: January 03, 2011, 06:59:01 am »
Hi,

I use the USPSv4 shipping module. It relies on predictable mail service names.

I've been throwing darts for a bit at trying to fix why no shipping options were showing up. It seems that they inserted html for making the REG text a superscript in all of the service names. removing it fixes this module. Here is how.

Changing line 314 in uspsv4.php

from This:
$serviceName = $serviceName->getText();

To this:
$serviceName = str_replace( "<sup>®</sup>" , "" , $serviceName->getText() ) ;

Seems to correct the issue.

The above corrects domestic shipping. Do the same for line 341 too and that should correct international.

Can you confirm the same on your end?
Reliable Web Hosting www.JIKOmetrix.net

seyi

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 405
    • AwoDev
Re: USPS changed its mail service names
« Reply #1 on: January 03, 2011, 12:23:19 pm »
Nice,  I originally edited the .cfg.php file to add  "<sup>®</sup>" and then used html_entity_decode to display the content correctly, but your way is better.  I do not know how long this code will work as it seems usps is changing things around, but at least for now I dont have complaining clients.
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

mbrando

  • Jr. Member
  • **
  • Posts: 68
    • www.JIKOmetrix.net
Re: USPS changed its mail service names
« Reply #2 on: January 03, 2011, 14:08:55 pm »
Hi Seyl,

It took hours of throwing darts to get figure out what exactly was the issue. At least we now know that it was related to naming convention and will look there first if they break it again.

- Mike
Reliable Web Hosting www.JIKOmetrix.net

mbrando

  • Jr. Member
  • **
  • Posts: 68
    • www.JIKOmetrix.net
Re: USPS changed its mail service names
« Reply #3 on: January 03, 2011, 14:35:25 pm »
Hi,

Also add this:

$serviceName = str_replace( "<sup>™</sup>" , "" , $serviceName);   

below this on 314 and 341:
$serviceName = str_replace( "<sup>®</sup>" , "" , $serviceName->getText() ) ;

- Mike
Reliable Web Hosting www.JIKOmetrix.net

Seiko

  • Jr. Member
  • **
  • Posts: 115
    • My finished site
Re: USPS changed its mail service names
« Reply #4 on: January 03, 2011, 22:12:47 pm »
Thanks for the fix!
Do you have questions and need some help for your Virtuemart project?
I'm ready to help you. Hire Me on oDesk

Jeremy - CodeDonors.com

  • Beginner
  • *
  • Posts: 14
  • I recommend Joomla + VirtueMart
    • CodeDonors.com
  • Skype Name: jmcdonald.codedonors
Re: USPS changed its mail service names
« Reply #5 on: January 07, 2011, 13:26:49 pm »
Just happened to be browsing the forum and this thread saved my life! Some time ago I developed a USPS Quotes with Insurance module, and now it is updated & ready for the new year. I also added just about every possible service option while I was at it.

Check it out here and stop footing the bill for insurance!

http://codedonors.com/shipping-modules/usps-quotes-with-insurance-virtuemart-p-44.html

Been doing this for a long time and still having fun :-)

PHP, Javascript, CSS, Bash, Perl and Python

FYI...WebHostManager (WHM) offers free SSL for all sites on the server via Sectigo and you can turn it on in under 5 minutes.

mbrando

  • Jr. Member
  • **
  • Posts: 68
    • www.JIKOmetrix.net
Re: USPS changed its mail service names
« Reply #6 on: January 07, 2011, 14:39:53 pm »
Just happened to be browsing the forum and this thread saved my life! Some time ago I developed a USPS Quotes with Insurance module, and now it is updated & ready for the new year. I also added just about every possible service option while I was at it.

Hi,

Since I saved your life and all ... I guess you owe me.   ;D

- Mike
Reliable Web Hosting www.JIKOmetrix.net