Jump to content

USPS International Shipping did it again!


Guest

Recommended Posts

Anyone out there still using CC3 and the USPS shipping module?

Unfortunately USPS messed with something again and now all the USPS International rates are not showing...only the domestic rates.

Does anyone know what they did/what code they changed?

:angry:

Link to comment
Share on other sites

They have added the registered trade mark symbol after the names of the mail services (I will refrain from commenting of the merits of such a change). I only have Express International Mail shipping option on my website so in my calc.php I changed

if(($sum>0) && (($api=="RateV2") || ($key=="Express Mail International"))){

to:

if(($sum>0) && (($api=="RateV2") || ($key=="Express Mail<sup>®</sup> International"))){

This allows the rate to be calculated and seen by the customer so they can buy off my website but they see the following as the shipping option:

USPS Express Mail <sup>&reg;</sup> International

I have not figure out how to fix how it looks. I have tried to use just &reg; for the trademark symbol but it does not work it wants it all spelled out to get the rate but then does not show the trademark on the website checkout, just the code for the trademark.

Don

Link to comment
Share on other sites

Guest hotspur29

I am having the same problem, but I do not have the same code in my calc.php file as the previous post. Are there any other solutions out there to solve this issue?

Link to comment
Share on other sites

This is a string that has had html special characters converted into their 'entities' so that the browser is told to show those exact characters and the user can actually see those characters. Where the conversion took place, I don't know.

"Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International"
is seen in the browser as
"USPS Express Mail <sup>&reg;</sup> International"


To do what you want - to have the html code to actually be html code - you need to decode the string first:
if(($sum>0) && (($api=="RateV2") || ($key=="Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International"))){

$key = html_entity_decode($key);

...

}

Then it should look like: USPS Express Mail ® International

But I can't confirm this extra statement won't break something elsewhere as my copy of the code for CC3.0.20 calc.php for USPS shipping module uses RateV3 (not V2), and doesn't have that if() statement in it anyway.

Link to comment
Share on other sites

My calc.php was modified to only allow Express Mail for outside of the USA. I found the way to modify it in the forums some time ago. Anyhow your additional code fixed my issue. I added this like you said and worked!

Here is what I added:

$key = html_entity_decode($key);

Here is my new line of code:

if(($sum>0) && (($api=="RateV2") || ($key=="Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International"))){

$key = html_entity_decode($key);

And now I get the trademark symbol on the website!

Thanks!

Link to comment
Share on other sites

I'm on the right track, but I was wondering if someone can tell me what I did wrong here.... all it's giving me is the priority international. I was hoping to also offer first class mail international package.

if(($sum>0) && (($api=="RateV3") || ($key=="First-Class Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Package") or ($key=="Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International"))){

$key = html_entity_decode($key);

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hi,

If you are using CubeCart V3.020 and need to remove the weird HTML form the customer view you need to modify the Modules/Shipping/USPS/calc.php. Find around line 188

foreach($rates as $key => $value){

Directly after that add

$key = html_entity_decode($key);

This worked for me. Now if I could just find a way to limit what international rates were returned and how to order them to show least expensive to most expensive, I would be good. LOL!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...