Jump to content

Resolved - Issue with USPS changes - July 28, 2013


Dirty Butter

Recommended Posts

I'm not finding any evidence that the skin you are using is setting any font-family -- well, "sans-serif". Font-size, yes. That said.... Realize I have not created an account on your store, and thus do not see the shipping options available. The screen grab you posted earlier shows the shipping selector, but I do not see it.

 

Firebug showed in the edit screen just that one line and that line had a black diamond? That is beyond bizarre.



A payment gateway can't change the shipping offset value. (Well, maybe it can. But it's not supposed to.)

Link to comment
Share on other sites

TRY::: In the file /USPS/shipping.class.php, around line 47, change

return html_entity_decode(str_replace('*','',$name));

to

return html_entity_decode(str_replace('*','',$name), ENT_COMPAT, 'UTF-8');

If that doesn't work, try:

return html_entity_decode(html_entity_decode(str_replace('*','',$name), ENT_COMPAT, 'UTF-8'), ENT_COMPAT, 'UTF-8');

Finally, try:

return htmlspecialchars_decode(str_replace('*','',$name));

Still, there must be something strange going on with your store.

 

Here is my shipping selector (4.25 pound item, so choices are appropriate for that):

(I'm going to have to figure out where these values are coming from -- There is no service in the response that is a even dollar amount.)

 

Link to comment
Share on other sites

return html_entity_decode(str_replace('*','',$name), ENT_COMPAT, 'UTF-8');

That shows correctly!! Now to see if that created the correct delivery choice on the Order Summary page. YES! The order shows the correct shipping choice.

 

Still, there must be something strange going on with your store.

 

i had the same issue on our Kurouto skin store, too, so I'm not sure why no one else has said anything about this happening.

 

I think the "all the shipping choices whether marked or not" issue was a cache problem. Will keep an eye on that, but otherwise this is FIXED!! THANK YOU!!

Link to comment
Share on other sites

It seems the issue with the black diamond stems from the change that USPS implemented in its rate quote response. They now use the HTML numerical entity for the Registered mark and Trademark.

 

PHP's html_entity_decode function in the USPS module -- for PHP 5.3 and earlier -- by default, returns an ISO-8859-1 byte-code equivalent. In PHP 5.4, the function returns a UTF-8 byte-code equivalent. So, the first suggest fix above is the correct fix.

 

However, a better fix would be to use a function that leaves the HTML numerical entities untouched and let's the browser show that character. Thus, the fourth suggested change.

Link to comment
Share on other sites

  • 2 weeks later...

First International Order since these edits, and it did not work correctly. Only the handling charge was charged as s/h. The applicable section of the Request Log shows:

 

<Country>CANADA</Country><Postage>7.35</Postage><ExtraServices/><ValueOfContents>16.00</ValueOfContents><InsComment>SERVICE</InsComment><SvcCommitments>Varies by destination</SvcCommitments><SvcDescription>First-Class Package International Service&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;**</SvcDescription>

 

This seems to indicate the issue is with CC, as 7.35 is the correct actual shipping charge for First Class Package International.

Link to comment
Share on other sites

  • 1 month later...

Should these edits still be in place for 5.2.4? When I try a test International order it seems to go all the way to PayPal for me, but we just had a customer write to say they had "struggled" to get shipping. Their pending order had $44 for s/h - which would have been Express - NOT what she wanted!

Link to comment
Share on other sites

At least I'm learning a little bit. I'd already checked that. The Request Log shows all the choices, just as it should, coming from USPS. I do have your edits in place, but wondered if maybe I should remove them. No , I vascilated on whether to try to add yours, but I did NOT add it to shipping.class.php.

Link to comment
Share on other sites

"I'd already checked that."

 

Yes, but I want to see it.

 

In CC524, the code is removing one of the two special characters, #174. It is not removing the special character #8482. But let's set aside bug #629 for the moment.

 

Bug #630 did not get implemented. In shipping.class.php, lines 155-156, change them to:

'name' => $this->cleanName((string)$option->MailService), // Bug#630 (string)$this->cleanName($option->MailService),
'value' => $this->plusHandling((float)$option->Rate), // Bug#630 (string)$this->plusHandling($option->Rate),

Also lines 174-175:

'name' => $this->cleanName((string)$option->SvcDescription), // Bug#630 (string)$this->cleanName($option->SvcDescription),
'value' => $this->plusHandling((float)$option->Postage), // Bug #630 (string)$this->plusHandling($option->Postage),
Link to comment
Share on other sites

Here's the FIRST attempt she made:

 

API=IntlRateV2&XML=<IntlRateV2Request USERID="XXXXX"> <Package ID="0"> <Pounds>0</Pounds> <Ounces>11</Ounces> <Machinable>false</Machinable> <MailType>Package</MailType> <ValueOfContents>4.00</ValueOfContents> <Country>Great Britain</Country> <Container>VARIABLE</Container> <Size>REGULAR</Size> <Width>26</Width> <Length>26</Length> <Height>26</Height> <Girth/> </Package> </IntlRateV2Request>

Response received <?xml version="1.0"?> <IntlRateV2Response><Package ID="0">...............<Service ID="12"><Pounds>0</Pounds><Ounces>11</Ounces><Machinable>false</Machinable><MailType>Package</MailType><Container>VARIABLE</Container><Size>REGULAR</Size><Width>26</Width><Length>26</Length><Height>26</Height><Girth>0</Girth><Country>GREAT BRITAIN</Country><Postage>72.45</Postage><ExtraServices/><ValueOfContents>4.00</ValueOfContents><InsComment>SERVICE</InsComment><SvcCommitments>1 - 3 business days</SvcCommitments><SvcDescription>USPS GXG&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Envelopes**</SvcDescription><MaxDimensions>USPS-Produced regular size cardboard envelope (12-1/2" x 9-1/2"), the legal-sized cardboard envelope (15" x 9-1/2") and the GXG Tyvek envelope (15-1/2" x 12-1/2")</MaxDimensions><MaxWeight>70</MaxWeight></Service><Service ID="1"><Pounds>0</Pounds><Ounces>11</Ounces><Machinable>false</Machinable><MailType>Package</MailType><Container>VARIABLE</Container><Size>REGULAR</Size><Width>26</Width><Length>26</Length><Height>26</Height><Girth>0</Girth><Country>GREAT BRITAIN</Country><Postage>51.85</Postage><ExtraServices/><ValueOfContents>4.00</ValueOfContents><InsComment>SERVICE</InsComment><SvcCommitments>3 - 5 business days</SvcCommitments><SvcDescription>Priority Mail Express International&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;</SvcDescription><MaxDimensions>Max. length 36", max. length plus girth 79"</MaxDimensions><MaxWeight>66</MaxWeight></Service><Service ID="26"><Pounds>0</Pounds><Ounces>11</Ounces><Machinable>false</Machinable><MailType>Package</MailType><Container>VARIABLE</Container><Size>REGULAR</Size><Width>26</Width><Length>26</Length><Height>26</Height><Girth>0</Girth><Country>GREAT BRITAIN</Country><Postage>79.95</Postage><ExtraServices><ExtraService><ServiceID>1</ServiceID><ServiceName>Insurance</ServiceName><Available>True</Available><Price>0.00</Price></ExtraService></ExtraServices><ValueOfContents>4.00</ValueOfContents><SvcCommitments>3 - 5 business days</SvcCommitments><SvcDescription>Priority Mail Express International&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Flat Rate Boxes</SvcDescription><MaxDimensions>USPS-Produced Box: 13-5/8" x 11-7/8" x 3-3/8" or 11" x 8-1/2" x 5-1/2"&lt;br&gt;Maximum weight 20 pounds.</MaxDimensions><MaxWeight>20</MaxWeight></Service><Service ID="2"><Pounds>0</Pounds><Ounces>11</Ounces><Machinable>false</Machinable><MailType>Package</MailType><Container>VARIABLE</Container><Size>REGULAR</Size><Width>26</Width><Length>26</Length><Height>26</Height><Girth>0</Girth><Country>GREAT BRITAIN</Country><Postage>42.00</Postage><ExtraServices/><ValueOfContents>4.00</ValueOfContents><InsComment>SERVICE</InsComment><SvcCommitments>6 - 10 business days</SvcCommitments><SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt;</SvcDescription><MaxDimensions>Max. length 60", max. length plus girth combined 108"</MaxDimensions><MaxWeight>66</MaxWeight></Service><Service ID="11"><Pounds>0</Pounds><Ounces>11</Ounces><Machinable>false</Machinable><MailType>Package</MailType><Container>VARIABLE</Container><Size>REGULAR</Size><Width>26</Width><Length>26</Length><Height>26</Height><Girth>0</Girth><Country>GREAT BRITAIN</Country><Postage>77.95</Postage><ExtraServices/><ValueOfContents>4.00</ValueOfContents><InsComment>SERVICE</InsComment><ParcelIndemnityCoverage>4.00</ParcelIndemnityCoverage><SvcCommitments>6 - 10 business days</SvcCommitments><SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Large Flat Rate Box</SvcDescription><MaxDimensions>USPS-Produced Box: 23-11/16" x 11-3/4" x 3" or 12" x 12" x 5-1/2"&lt;br&gt;Maximum weight 20 pounds.</MaxDimensions><MaxWeight>20</MaxWeight></Service><Service ID="9"><Pounds>0</Pounds><Ounces>11</Ounces><Machinable>false</Machinable><MailType>Package</MailType><Container>VARIABLE</Container><Size>REGULAR</Size><Width>26</Width><Length>26</Length><Height>26</Height><Girth>0</Girth><Country>GREAT BRITAIN</Country><Postage>59.95</Postage><ExtraServices/><ValueOfContents>4.00</ValueOfContents><InsComment>SERVICE</InsComment><ParcelIndemnityCoverage>4.00</ParcelIndemnityCoverage><SvcCommitments>6 - 10 business days</SvcCommitments><SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Medium Flat Rate Box</SvcDescription><MaxDimensions>USPS-Produced Box: 13-5/8" x 11-7/8" x 3-3/8" or 11" x 8-1/2" x 5-1/2"&lt;br&gt;Maximum weight 20 pounds.</MaxDimensions><MaxWeight>20</MaxWeight></Service><Service ID="16"><Pounds>0</Pounds><Ounces>11</Ounces><Machinable>false</Machinable><MailType>Package</MailType><Container>VARIABLE</Container><Size>REGULAR</Size><Width>26</Width><Length>26</Length><Height>26</Height><Girth>0</Girth><Country>GREAT BRITAIN</Country><Postage>23.95</Postage><ExtraServices/><ValueOfContents>4.00</ValueOfContents><InsComment>SERVICE</InsComment><SvcCommitments>6 - 10 business days</SvcCommitments><SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Small Flat Rate Box**</SvcDescription><MaxDimensions>USPS-Produced Box: 8-5/8" x 5-3/8" x 1-5/8"&lt;br&gt;Maximum weight 4 pounds.</MaxDimensions><MaxWeight>4</MaxWeight></Service><Service ID="24"><Pounds>0</Pounds><Ounces>11</Ounces><Machinable>false</Machinable><MailType>Package</MailType><Container>VARIABLE</Container><Size>REGULAR</Size><Width>26</Width><Length>26</Length><Height>26</Height><Girth>0</Girth><Country>GREAT BRITAIN</Country><Postage>23.95</Postage><ExtraServices/><ValueOfContents>4.00</ValueOfContents><InsComment>SERVICE</InsComment><SvcCommitments>6 - 10 business days</SvcCommitments><SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; DVD Flat Rate priced box**</SvcDescription><MaxDimensions>USPS-Produced Box: 7-9/16" x 5-7/16" x 5/8"&lt;br&gt;Maximum weight 4 pounds.</MaxDimensions><MaxWeight>4</MaxWeight></Service><Service ID="25"><Pounds>0</Pounds><Ounces>11</Ounces><Machinable>false</Machinable><MailType>Package</MailType><Container>VARIABLE</Container><Size>REGULAR</Size><Width>26</Width><Length>26</Length><Height>26</Height><Girth>0</Girth><Country>GREAT BRITAIN</Country><Postage>23.95</Postage><ExtraServices/><ValueOfContents>4.00</ValueOfContents><InsComment>SERVICE</InsComment><SvcCommitments>6 - 10 business days</SvcCommitments><SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Large Video Flat Rate priced box**</SvcDescription><MaxDimensions>USPS-Produced Box: 9-1/4" x 6-1/4" x 2"&lt;br&gt;Maximum weight 4 pounds.</MaxDimensions><MaxWeight>4</MaxWeight></Service><Service ID="15"><Pounds>0</Pounds><Ounces>11</Ounces><Machinable>false</Machinable><MailType>Package</MailType><Container>VARIABLE</Container><Size>REGULAR</Size><Width>26</Width><Length>26</Length><Height>26</Height><Girth>0</Girth><Country>GREAT BRITAIN</Country><Postage>14.90</Postage><ExtraServices/><ValueOfContents>4.00</ValueOfContents><InsComment>SERVICE</InsComment><SvcCommitments>Varies by destination</SvcCommitments><SvcDescription>First-Class Package International Service&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;**</SvcDescription><MaxDimensions>Other than rolls: Max. length 24", max length, height and depth (thickness) combined 36"&lt;br&gt;Rolls: Max. length 36". Max length and twice the diameter combined 42"</MaxDimensions><MaxWeight>4</MaxWeight></Service></Package></IntlRateV2Response>

 

The 14.90 First Class Package International right near the end would have been what she was trying to choose.

 

There are 10 identical, as far as I can tell, entries in the Request Log for her order, where she tried over and over to get it to work for her.

 

I'll look back, but I don't think it used to pull up all those Prohibitions, etc., every time an international order was placed - maybe so. It had all the prohibitions in a 9/14 order mailed to UK, so I'm deleting all that part of the Request Log info above.

Link to comment
Share on other sites

Well, it was actually 44.35, which I think means I didn't carry over your fix for that handling issue. Thanks.

 

I just logged out of Admin, in case that was why I can create test orders properly. I was still able to take a UK order all the way to PayPal - not paying, of course. Hopefully your edits worked.

 

Now I'll see if I can get handling working right again.

Link to comment
Share on other sites

"Well, it was actually 44.35, which I think means I didn't carry over your fix for that handling issue."

 

Then that figure would match if your handling is 2.35. In the Response you quoted above (direct from USPS), Priority Mail International is 42.00.

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