Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Guest

Recommended Posts

6 minutes ago, cigarsforless said:

so perhaps it is as easy as just changing the 80 to 443 in the code from my post above?

nope, tried to change just the 80 to 443 and no results at all are returned 😪

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to OSC CE Phoenix)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 1 year later...

I noticed today that domestic priority quotes seem to have changed from Priority MailTM to Priority MailRM  and as such quotes aren't being displayed.

The water in a vessel is sparkling; the water in the sea is dark. The small truth has words which are clear; the great truth has great silence.

- Rabindranath Tagore

Link to comment
Share on other sites

was scratching my head trying to figure out why domestic rates are failing but international are still working

 

thanks so much!

changed the TM to RM in the usps.php file but still no domestic rates,
sigh, I really hate the post office devs

 

Edited by cigarsforless

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to OSC CE Phoenix)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Link to comment
Share on other sites

15 minutes ago, cigarsforless said:

was scratching my head trying to figure out why domestic rates are failing but international are still working

 

thanks so much!

changed the TM to RM in the usps.php file but still no domestic rates,
sigh, I really hate the post office devs

 

I manually changed the configuration_key MODULE_SHIPPING_USPS_TYPES in the configuration table in the database as well. If you already made the changes in usps.php, then removing and installing the module would update the table. Seems to work ok now. Yeah, really tired of the usps api changes over the years.😠

The water in a vessel is sparkling; the water in the sea is dark. The small truth has words which are clear; the great truth has great silence.

- Rabindranath Tagore

Link to comment
Share on other sites

17 minutes ago, Smoky Barnable said:

I manually changed the configuration_key MODULE_SHIPPING_USPS_TYPES in the configuration table in the database as well. If you already made the changes in usps.php, then removing and installing the module would update the table. Seems to work ok now. Yeah, really tired of the usps api changes over the years.😠

 

 

YAY! that worked, I owe you a beer for sure

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to OSC CE Phoenix)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Link to comment
Share on other sites

I've made the changes to get Priority quotes back, but am not receiving any Express (domestic or international) quotes.  Is anyone else experiencing this?

 

I see nothing in the web tools releases to indicate that any changes were made to Express, but they are doing external testing on the 7/28 update starting today - so maybe that's impacting functionality?

 

EDIT - had to change the TM to RM on the Express options too.  Everything works now.  

Edited by otgrouch
Link to comment
Share on other sites

I wish I had known to check the forums a long time ago, because I updated the USPS module myself to the rate api v4, and intl rate api v2, and I did all the work of upgrading to https all by myself.  I think you'll like my solution to the service names problem.  Back when I upgraded the module in 2020 I wrote some regular expressions to match the basic service types without having to worry about whether it was Priority Mail one-day, or two-day (let alone whether it was TM or RM), and since that time it still works without me having to modify those regexes to keep up with USPS' changes.

The only caveat is that my module assumes you have access to commercial plus pricing.  The other downside is that the allowed service types are hard coded into the module instead of having radio button selections of which services are allowed.

usps.php

Link to comment
Share on other sites

I recently noticed I'm giving out quotes for Parcel Select Ground Cubic, which is not a problem for my store, but could be for others.  So I changed line 60 from:

'/Ground/i',

 to:

'/(?!.*?Cubic)Ground/i',

So that it would just show the vanilla pricing for parcel select ground (or retail ground if you change the request body to get retail prices).  Again, this is the first change I've had to make to the service types since I upgraded the module to the new api version.

Link to comment
Share on other sites

Oops, I made a mistake. I may be running an older version of USPS Rate V4 and was intending to check if it should be updated. I see "ver R3.3" on my installed version, running osC v2.3.4.  If 3.3 is not the latest USPS version, would someone be so kind as to post the latest download here? I noticed that this, and all the other apps, are gone.  http://addons.oscommerce.com/info/8327 redirected to https://www.oscommerce.com/info/8327, returned a cert error and then page not found. If you can help, please post here or message me. Was also going to install UPS soon but did not get there in time.

Thank you!

 

 

Link to comment
Share on other sites

I have both "Ship in Cart" and the "USPS Rate V4 Intl Rate V2_r1.8" modules installed on my live site (osC v2.3.4 BS (yes, it's old)).

I was contacted by a customer this morning trying to place an order, but claimed that they couldn't.

(They received an error message saying "We can not find this shipping address. This is usually caused by a bad ZIP code. Please double check the address you have entered". This is an edit I made to the ERROR_NO_SHIPPING_AVAILABLE_TO_SHIPPING_ADDRESS field in  /includes/languages/english/checkout_shipping.php,  as I found this was the most common mistake customers made. However, that isn't the case here.)

After seeing the latest posts in this thread, I started to examine the code on our site. Working on my in-house test server, I have tried to replace all of the instances of TM to RM in /included/modules/shipping/usps.php , and there was no change. Do note that if you do a mass find-and-replace, there will be a couple of unintended changes (like changing HTML to HRML in one place, and GXGTM to GXGRM in another), so be careful.

I edited the configuration_key MODULE_SHIPPING_USPS_TYPES in the configuration table, and there was no change.

I un-installed and re-installed the USPS module (with the edits), and still no change.

Logging into my live (and un-edited) site, I enables SEND DEBUG EMAIL in the USPS shipping module, and ran a test order. The USPS did return a debug email, but it looks like it did actually return a valid shipping cost. I have attached the debug email below (re-formatted for clarity) ...

Quote

Request:
API=RateV4&XML=<RateV4Request USERID="959ARTCO0118">
      <Revision>2
      </Revision>

   <PackageID="0">
      <Service>
         PRIORITY OMMERCIAL
      </Service>
      <ZipOrigination>
         95112
      </ZipOrigination>
      <ZipDestination>
         95112
      </ZipDestination>
      <Pounds>
         0
      </Pounds>
      <Ounces>
         12
      </Ounces>
      <Container>
         VARIABLE
      </Container>
      <Size>
         REGULAR
      </Size>
      <Machinable>
         TRUE
      </Machinable>
   </Package>

   <Package ID="1">
      <Service>
         EXPRESS COMMERCIAL
      </Service>
      <ZipOrigination>
         95112
      </ZipOrigination>
      <ZipDestination>
         95112
      </ZipDestination>
      <Pounds>
         0
      </Pounds>
      <Ounces>
         12
      </Ounces>
      <Container>
         VARIABLE
      </Container>
      <Size>
         REGULAR
      </Size>
      <Machinable>
         TRUE
      </Machinable>
   </Package>
</RateV4Request>


Response:
<?xml version="1.0" encoding="UTF-8"?>
   <RateV4Response>
      <PackageID="0">
         <ZipOrigination>
            95112
         </ZipOrigination>
         <ZipDestination>
            95112
         </ZipDestination>
         <Pounds>
            0
         </Pounds>
         <Ounces>
            12
         </Ounces>
         <Container>
            VARIABLE
         </Container>
         <Zone>
            1
         </Zone>
         <PostageCLASSID="1">
            <MailService>
               Priority Mail&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt;
            </MailService>
            <Rate>
               8.70
            </Rate>
            <CommercialRate>
               7.37
            </CommercialRate>
            <SpecialServices>
               <SpecialService>
                  <ServiceID>
                     119
                  </ServiceID>
                  <ServiceName>
                     AdultSignatureRequired
                  </ServiceName>
                  <Available>
                     true
                  </Available>
                  <AvailableOnline>
                     true
                  </AvailableOnline>
                  <Price>
                     8.50
                  </Price>
                  <PriceOnline>
                     8.50
                  </PriceOnline>
               </SpecialService>
               <SpecialService>
                  <ServiceID>
                     120
                  </ServiceID>
                  <ServiceName>
                     Adult Signature Restricted Delivery
                  </ServiceName>
                  <Available>
                     true
                  </Available>
                  <AvailableOnline>
                     true
                  </AvailableOnline>
                  <Price>
                     8.75
                  </Price>
                  <PriceOnline>
                     8.75
                  </PriceOnline>
               </SpecialService>
               <SpecialService>
                  <ServiceID>
                     104
               </ServiceID>
               <ServiceName>
                  Certificate of Mailing (Form3817)
               </ServiceName>
               <Available>
                  true
               </Available>
               <AvailableOnline>
                  true
               </AvailableOnline>
               <Price>
                  1.75
               </Price>
               <PriceOnline>
                  1.75
               </PriceOnline>
            </SpecialService>
            <SpecialService>
               <ServiceID>
                  105
               </ServiceID>
               <ServiceName>
                  Certified Mail&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt;
               </ServiceName>
               <Available>
                  true
               </Available>
               <AvailableOnline>
                  true
               </AvailableOnline>
               <Price>
                  4.00
               </Price>
               <PriceOnline>
                  4.00
               </PriceOnline>
            </SpecialService>
            <SpecialService>
               <ServiceID>
                  170
               </ServiceID>
               <ServiceName>
                  CertifiedMail&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; RestrictedDelivery
               </ServiceName>
               <Available>
                  true
               </Available>
               <AvailableOnline>
                  true
               </AvailableOnline>
               <Price>
                  10.35
               </Price>
               <PriceOnline>
                  10.35
               </PriceOnline>
            </SpecialService>
            <SpecialService>
               <ServiceID>
                  171
               </ServiceID>
               <ServiceName>
                  CertifiedMail&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Adult Signature Required
               </ServiceName>
               <Available>
                  true
               </Available>
               <AvailableOnline>
                  true
               </AvailableOnline>
               <Price>
                  10.35
               </Price>
               <PriceOnline>
                  10.35
               </PriceOnline>
            </SpecialService>
            <SpecialService>
               <ServiceID>
                  172
               </ServiceID>
               <ServiceName>
                  CertifiedMail&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Adult Signatu

Errors:

 

While the response it truncated,  there does not appear to be any errors reported.

Does anyone have any suggestions of what to try next?

TIA

Malcolm

 

Link to comment
Share on other sites

I have changed all the Priority MailTM and Priority Mail ExpressTM entries to the RM, and so far I'm not receiving any Priority Mail quotes.

Mention is made above of manually changing the configuration_key MODULE_SHIPPING_USPS_TYPES in the configuration table in the database. Can someone tell me how to do this, or how to remove and add the USPS module?

Thanks for any help,
Ron

Link to comment
Share on other sites

6 hours ago, GetSirius said:

Oops, I made a mistake. I may be running an older version of USPS Rate V4 and was intending to check if it should be updated. I see "ver R3.3" on my installed version, running osC v2.3.4.  If 3.3 is not the latest USPS version, would someone be so kind as to post the latest download here? I noticed that this, and all the other apps, are gone.  http://addons.oscommerce.com/info/8327 redirected to https://www.oscommerce.com/info/8327, returned a cert error and then page not found. If you can help, please post here or message me. Was also going to install UPS soon but did not get there in time.

Thank you!

 

 

sadly it seems that all the apps made over decades in support of the original versions of osCommerce are no longer available online via this site.
while I understand the new owners want to move forward, tossing out access to all the legacy addons is nonproductive in my humble opinion.
At least the forum is still here (for now?)

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to OSC CE Phoenix)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Link to comment
Share on other sites

On 7/10/2022 at 10:45 PM, Smoky Barnable said:

I manually changed the configuration_key MODULE_SHIPPING_USPS_TYPES in the configuration table in the database as well. If you already made the changes in usps.php, then removing and installing the module would update the table. Seems to work ok now. Yeah, really tired of the usps api changes over the years.😠

Many, many thanks for this.  I changed all the Priority MailTM, Priority Mail ExpressTM, and Priority Mail Express InternationalTM to "RM", but it didn't work.  Saw your post and changed the items in the key MODULE_SHIPPING_USPS_TYPES of the configuration table with phpMyAdmin, and everything worked - no need to uninstall and re-install the USPS module.

It's great to see that the legacy oscommerce forum stuff works.  I didn't know about this, although I've had a customer or two order with UPS shipping options (the only shipping working, unbeknownst to me).  I thought that was strange, but sometimes customers choose higher rates for their own reasons.  However, I got an e-mail this morning because I had subscribed to this thread.  I hadn't logged into the oscommerce forum in over a year, but got all of this fixed in about a half-hour.

YAYYY!

P.S. Still stuck on Phoenix 1.0.5, but I guess that's another whole story ... and forum, too!

Edited by TomB01
Link to comment
Share on other sites

On 7/14/2022 at 7:45 PM, rwest said:

I have changed all the Priority MailTM and Priority Mail ExpressTM entries to the RM, and so far I'm not receiving any Priority Mail quotes.

Mention is made above of manually changing the configuration_key MODULE_SHIPPING_USPS_TYPES in the configuration table in the database. Can someone tell me how to do this, or how to remove and add the USPS module?

Thanks for any help,
Ron

See my post above.

Go into phpMyAdmin on your Internet Host's Control Panel (or whatever they use) and access your oscommerce MySQL database.  click on the "configuration" table and scroll through all of the lines to find the USPS keys.  There's a bunch of them and my configuration is 30+ lines now, so it may take you a while.  Don't get mixed up with UPS keys, if you have them.  Anyway, find the MODULE_SHIPPING_USPS_TYPES key, click on the "configuration_value" column for that key, and edit out the TM values to "RM."

You need to be very careful doing this, because you can blow up the database if you mess something else up.  Unless you are fairly confident with phpMyAdmin, the safer way is to uninstall and re-install the USPS shipping module, as suggested earlier.  You do that in the oscommerce Admin Control Panel.  Login as Admin to your store and the Admin Control Panel (or whatever you may be calling it).  Look for Modules->Shipping.  Click on "- Remove Module."  After you've done that, go right back and click on "Install Module," select "USPS," and install it.

WARNING: Print out all of your USPS settings on the right hand side of the page before you uninstall the module.  I believe you're going to have re-edit all of those settings when you uninstall and re-install the module.  That's why I went for manually editing the database, but as mentioned - that can be dangerous if you're not confident about what you're doing.

P.S. I'm running Phoenix, so your mileage may vary from that description above.

 

Edited by TomB01
Link to comment
Share on other sites

Thanks to everyone for picking up on this.

As I understand it, USPS gained their trademark registration for the terms "Priority Mail" and "Priority Mail Express" hence the change from a trademark to a registered trademark. Note that the International services are still not registered so we have that change to deal with at some time in the future.

As noted above, any instances of TM for these services need to change to RM.  However in some other USPS module versions,  you would be changing tradmrk to regimark.  And it is only matters if you actually use these services (although it makes sense for all USPS users to patch their modules).

Hope this helps some poor soul in the future especially now the Add Ons are gone.  I have taken the liberty of adding the zip file that Tom provided to our blog post in case it disappears from here.   See https://www.ozeworks.com/usps-does-it-again/

 

Link to comment
Share on other sites

  • 2 weeks later...

Ok, new problem ...

With the above edits, the module is working ... HOWEVER ...

I have 'Send Debug Email' set to true. Here is a snippet from the debug email for the latest order. Note the lines highlighted in red ...

Quote

  <RateV4Response>
    <PackageID="0">
      <ZipOrigination>95112</ZipOrigination>
      <ZipDestination>19807</ZipDestination>
      <Pounds>2</Pounds>
      <Ounces>2.4</Ounces>
      <Container>VARIABLE</Container>
      <Zone>8</Zone>
      <PostageCLASSID="1">
        <MailService>PriorityMail&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt;</MailService>
        <Rate>21.20</Rate>
        <CommercialRate>17.74</CommercialRate>

        <SpecialServices>

My problem is ... my customers are being charged the 'CommercialRate' ($17.74). But, when I go online to print the shipping label, I get charge the "regular" rate ($21.20).

I had the 'Retail pricing or Online pricing' option set to 'Online'. I have just changed it to 'Retail'. Let's see if that fixes things ...

Malcolm

Link to comment
Share on other sites

On 7/31/2022 at 9:11 AM, ArtcoInc said:

I had the 'Retail pricing or Online pricing' option set to 'Online'. I have just changed it to 'Retail'. Let's see if that fixes things

That was it. I must have missed that setting when I un-installed and re-installed the module.

Malcolm

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