Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

USPS Rate V4, Intl Rate V2 (official support thread)


Guest

Recommended Posts

If you lost First-Class, they changed the name on March 7. It is now First-Class MailRM Letter OR Parcel (may vary based on HTML entities). I found the latest document through this link from google:

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCoQFjAA&url=https%3A%2F%2Fes.usps.com%2Fbusiness%2Fweb-tools-apis%2F2014-march-webtools-release-notes.rtf&ei=bHIeU9eqJ7Hy0QHp2oH4Cw&usg=AFQjCNFgJUI2WT4sYomB-7cHLmYhioCrFQ&sig2=H2_uLPMPdrsMPaNNIBbXJg&bvm=bv.62788935,d.dmQ&cad=rja

Edited by brettmb
Link to comment
Share on other sites

Sites using the latest version of this module with First Class Parcel turned on seem to still work. Post here if yours is not working, and what First Class option you are using (parcel or letter) so I can debug this.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hello!

I have discovered a problem within my admin > Categories Products > new product

When I attempt to use "Restrict USPS Shipping Methods" the radio boxes don't have any affect on the front ends checkout shipping options. Also, they don't stay checked after the listing is saved. Also, there are more radio boxes than options...post-236327-0-68409700-1394569202_thumb.png

Link to comment
Share on other sites

If you lost First-Class, I've posted an update that resolves that issue. Install the update and you should get all possible First-Class rates for both domestic and international (yes, this includes Letter rates).

Also updated the language file for this module, for those who show international regulations.

 

http://addons.oscommerce.com/info/8702

Edited by a.forever
Link to comment
Share on other sites

Same solution as this post. Let us know if you need help interpreting the results.

 

Regards

Jim

 

Jim,

 

I updated with a.forever's last version of the mod and my first class is working again.

 

I am still having the problem with shipping showing up as u: in the checkout screen. It seems to be random, but only happens when a customer chooses USPS as the shipping method. Here are two emails from the mod. The first is from when the customer checked the rates and the second is at checkout. Keep in mind that the checkout_shipping screen allows them to choose the USPS method. It is the confirmation screen where it seems to get dropped.

 

10:51 AM

Request:

API=RateV4&XML=<RateV4Request USERID="xxxxxxxxxx"><Revision>2</Revision><Package ID="0"><Service>STANDARD POST</Service><ZipOrigination>30276</ZipOrigination><ZipDestination>55008</ZipDestination><Pounds>0</Pounds><Ounces>15</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>TRUE</Machinable></Package><Package ID="1"><Service>PRIORITY COMMERCIAL</Service><ZipOrigination>30276</ZipOrigination><ZipDestination>55008</ZipDestination><Pounds>0</Pounds><Ounces>15</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>TRUE</Machinable></Package></RateV4Request>

 

Response:

<?xml version="1.0" encoding="UTF-8"?>

<RateV4Response><Package ID="0"><ZipOrigination>30276</ZipOrigination><ZipDestination>55008</ZipDestination><Pounds>0</Pounds><Ounces>15</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>TRUE</Machinable><Zone>5</Zone><Postage CLASSID="4"><MailService>Standard PostRM</MailService><Rate>5.87</Rate><SpecialServices><SpecialService><ServiceID>9</ServiceID><ServiceName>Certificate of Mailing</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>1.30</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>1</ServiceID><ServiceName>Insurance</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>2.10</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>13</ServiceID><ServiceName>USPS TrackingTM</ServiceName><Available>true</Available><AvailableOnline>true!

</AvailableOnline><Price>0.00</Price><PriceOnline>0.00</PriceOnline></SpecialService><SpecialService><ServiceID>7</ServiceID><ServiceName>Return Receipt for Merchandise</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>4.40</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>15</ServiceID><ServiceName>Signature ConfirmationTM</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>2.90</Price><PriceOnline>2.35</PriceOnline></SpecialService><SpecialService><ServiceID>6</ServiceID><ServiceName>Collect on Delivery</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>6.95</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>true</DueSenderRequired></SpecialService></SpecialServices></Postage></Package><Package ID="1"><ZipOrigination>30276</ZipOrigination><ZipDestination>55008</ZipDestination><Pounds>0!

</Pounds><Ounces>15</Ounces><Container>VARIABLE</Container><Size>REGUL

 

AR</Size><Zone>5</Zone><Postage CLASSID="1"><MailService>Priority Mail 2-DayTM</MailService><Rate>6.00</Rate><CommercialRate>5.54</CommercialRate><SpecialServices><SpecialService><ServiceID>9</ServiceID><ServiceName>Certificate of Mailing</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>1.30</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>1</ServiceID><ServiceName>Insurance</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>2.10</Price><PriceOnline>2.10</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>5</ServiceID><ServiceName>Registered MailTM</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>11.95</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></Specia!

lService><SpecialService><ServiceID>4</ServiceID><ServiceName>Registered without Insurance</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>11.95</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>0</ServiceID><ServiceName>Certified MailRM</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>3.30</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>13</ServiceID><ServiceName>USPS TrackingTM</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>0.00</Price><PriceOnline>0.00</PriceOnline></SpecialService><SpecialService><ServiceID>7</ServiceID><ServiceName>Return Receipt for Merchandise</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>4.40</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>15</ServiceID><ServiceName>Signature ConfirmationTM</ServiceName><A!

vailable>true</Available><AvailableOnline>true</AvailableOnline><Price

 

>2.90</Price><PriceOnline>2.35</PriceOnline></SpecialService><SpecialService><ServiceID>19</ServiceID><ServiceName>Adult Signature Required</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>5.20</PriceOnline></SpecialService><SpecialService><ServiceID>20</ServiceID><ServiceName>Adult Signature Restricted Delivery</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>5.45</PriceOnline></SpecialService><SpecialService><ServiceID>6</ServiceID><ServiceName>Collect on Delivery</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>6.95</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>true</DueSenderRequired></SpecialService></SpecialServices></Postage></Package></RateV4Response>

 

11:02AM

Request:

API=RateV4&XML=<RateV4Request USERID="xxxxxxxx"><Revision>2</Revision><Package ID="0"><Service>STANDARD POST</Service><ZipOrigination>30276</ZipOrigination><ZipDestination>55008</ZipDestination><Pounds>0</Pounds><Ounces>15</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>TRUE</Machinable></Package><Package ID="1"><Service>PRIORITY COMMERCIAL</Service><ZipOrigination>30276</ZipOrigination><ZipDestination>55008</ZipDestination><Pounds>0</Pounds><Ounces>15</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>TRUE</Machinable></Package></RateV4Request>

 

Response: (This was blank)

Link to comment
Share on other sites

The first response is broken, probably by the USPS switch to Chunked encoding that they pulled on us last year. The solution is to use the latest version of this module.

 

The second one has no response at all, which means that USPS timed out or completely failed to respond. Nothing I can do about that.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I updated with a.forever's last version of the mod and my first class is working again.

 

I am still having the problem with shipping showing up as u: in the checkout screen. It seems to be random, but only happens when a customer chooses USPS as the shipping method. Here are two emails from the mod. The first is from when the customer checked the rates and the second is at checkout. Keep in mind that the checkout_shipping screen allows them to choose the USPS method. It is the confirmation screen where it seems to get dropped.

 

Glad to see the add-on working.

 

I would assume you've modded either your checkout_shipping.php or checkout_confirmation.php (or some other PHP file involved in confirmation) and it isn't pulling the rates from the shipping module. It may be a confliction with another add-on or some other coding issue.

Link to comment
Share on other sites

The first response is broken, probably by the USPS switch to Chunked encoding that they pulled on us last year. The solution is to use the latest version of this module.

 

The second one has no response at all, which means that USPS timed out or completely failed to respond. Nothing I can do about that.

 

Regards

Jim

 

Thanks Jim.

 

The first response actually generated the quotes properly. I am using the latest version. It is the one that a.forever put up this morning.

 

As far as the second one, I have a few questions:

 

1. Am I the only person this happens to?

2. If the shipping shows up at checkout_shipping is there any reason that the mod has to resend the request to the USPS at checkout_confirmation?

3. If it does have to resend, is there a way that I can prevent the customer from checking out if there is no shipping method listed (other than u:) at checkout_confirmation?

 

Thanks again for your help. This used to happen rarely, but over the past week it is 4 or 5 times a day and increasing in frequency.

 

Best Regards,

Steve

Link to comment
Share on other sites

Glad to see the add-on working.

 

I would assume you've modded either your checkout_shipping.php or checkout_confirmation.php (or some other PHP file involved in confirmation) and it isn't pulling the rates from the shipping module. It may be a confliction with another add-on or some other coding issue.

 

Hi Kevin,

 

The weird thing is that it works most of the time. We run 100-150 orders per day, roughly half are USPS shipping, and we end up with a handful with this problem. Sometimes we go weeks without it occurring.

Link to comment
Share on other sites

@@beemertec

  1. As far as I know. I don't recall anyone else reporting this.
  2. It's the way osCommerce is written. Changing that would require caching the selected shipping method somehow, probably in the session. That's going to take some work.
  3. osC only checks the availability of a shipping quote on the Checkout Shipping page. You would have to add code to a subsequent page (Checkout Confirmation?) to check it again. More work.

That single letter in the response looks to me like a mistyped array. The response code is somehow being saved as an array when it needs to be a string. PHP typically throws a warning (which is usually suppressed in osC) and then whacks the array into a string, resulting in a single character. I suggest checking your PHP error log when you discover one of these has happened.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Jim, regarding 2. That is exactly what I implemented in the modified code I sent to you for consideration for inclusion in your re-write. I saved shipping info in the session to avoid all of the unnecessary instances of re-quoting. This sped things up greatly.

Link to comment
Share on other sites

@@DrGlitch Yes, and I still have that code. I was going to add it to the new module. Unfortunately, paying work has kept me too busy to work on that lately, so there it sits. Please feel free to release it yourself if you want. I have no idea when I will have the time to finish that.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@DrGlitch Yes, and I still have that code. I was going to add it to the new module. Unfortunately, paying work has kept me too busy to work on that lately, so there it sits. Please feel free to release it yourself if you want. I have no idea when I will have the time to finish that.

 

Regards

Jim

 

Jim,

 

Do you think this code would correct the issue we are having? If so, I am willing to donate to the cause if you would let me know the cost. I know you are busy, and you get paid to do this kind of thing. I am happy to pay to help expedite the process.

 

Best Regards,

Steve

Link to comment
Share on other sites

I don't know that it would help. It might, or it might be just a waste of time. We really don't know what the cause is.

 

Since nobody else seems to be having this problem, it is more likely that it is some other change in your store that is causing the problem. In that case this code would probably not help.

 

In any case, my problem is that my paying jobs are taking all of my time. Adding another paying job would not help that.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I apologize if this has been asked before, but any hints on how to upgrade from a USPS Methods 5.2.2 install?

 

It looks like USPS Rate V4 is fairly self-contained with the usps.php files. However, an installed Methods appears to have changes in:

 

catalog/checkout_shipping.php

catalog/includes/application_top.php

catalog/includes/modules/order_total/ot_shipping.php

catalog/includes/functions/general.php

catalog/admin/modules.php

 

I don't appear to have a shipping estimator in place and I definitely don't have one-page checkout, so those files are not involved.

 

 

Edit: Upgrade is a misnomer in this context. I am talking about completely removing Methods to install Rate.

Edited by TomB01
Link to comment
Share on other sites

I would remove all of those changes and add the ones for the V4 module. I believe that the changes to the admin/modules.php are the same, so that could be left. The others are not needed and may cause problems, so it would be better to remove them.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

@@surknight Sorry, I missed this post. I don't see what's wrong with that line. Possibly a new version of PHP is responsible. I don't know if the .NET update would also update PHP, but I wouldn't be surprised. Or it just could be a bug in PHP.

Thanks Jim. I'll post if I figure it out.

 

Fixed it!

 

Apparently, the stringable objects needed to be explicitly cast to strings as explained in the PHP Manual, so the problem line is now:

 

if (tep_not_null($iExtras[(string) $val]) && (array_key_exists ('ServiceName', $iExtras[(string) $val]) && tep_not_null($iExtras[(string) $val['ServiceName']]) && ((constant('MODULE_SHIPPING_USPS_RATE_TYPE_' . $vendors_id) == 'Online' && $val[(string) 'AvailableOnline'] == 'True') || (constant('MODULE_SHIPPING_USPS_RATE_TYPE_' . $vendors_id) == 'Retail' && $val[(string) 'Available'] == 'True')))) {

 

That gets rid of the warning on international quotes.

 

Here are the patched files:

 

Non-vendor: usps.php

MVS variant (rename to usps.php before installing): usps-mvs.php

Link to comment
Share on other sites

Thanks for the fix. PHP used to cast those automatically, so apparently that has changed. I'll have to remember that for future code.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Is there a trick to getting the signature confirmation to work? I have specified a dollar amount at which SC should be added and entered the post office price, online price, and then just a random price, but it never adds SC into the shipping price.

 

Has anyone else had difficulty getting the SC portion of this module to work?

 

Thanks for any help you can provide : )

Link to comment
Share on other sites

Try just clicking H on Signature Confirmation. The module should add the cost of Signature Confirmation into the shipping cost. Does that work?

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Thanks for your reply. I am not sure what you mean by "clicking H" on signature confiramtion? I have the USPS module activated, with SC to be added for an order total of $250 or greater. However, when I add products to a shopping cart that total greater than $250, the shipping cost is the actual cost only and does not have the cost of SC added in.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...