News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

USPS changed its mail service names

Started by mbrando, January 03, 2011, 06:59:01 AM

Previous topic - Next topic

mbrando

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

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

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

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

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

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

Quote from: Jmcdo999 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.

Hi,

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

- Mike
Reliable Web Hosting www.JIKOmetrix.net