Jump to content
fulluvscents

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

Recommended Posts

using CE Frozen, running php 7.0.*

In the error log I see these notices...not a critical issue at this time but for housekeeping purposes would be nice to fix.  Any ideas?

[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined index: PriorityMailExpress in /home/UserName/public_html/includes/modules/shipping/usps.php on line 91
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined variable: shipping_method in /home/UserName/public_html/includes/modules/shipping/zones.php on line 161
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined variable: shipping_cost in /home/UserName/public_html/includes/modules/shipping/zones.php on line 162
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined offset: 0 in /home/UserName/public_html/includes/modules/shipping/usps.php on line 428
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined offset: 1 in /home/UserName/public_html/includes/modules/shipping/usps.php on line 428
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined offset: 2 in /home/UserName/public_html/includes/modules/shipping/usps.php on line 428
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined offset: 3 in /home/UserName/public_html/includes/modules/shipping/usps.php on line 428
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined offset: 4 in /home/UserName/public_html/includes/modules/shipping/usps.php on line 428
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined offset: 5 in /home/UserName/public_html/includes/modules/shipping/usps.php on line 428
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined offset: 6 in /home/UserName/public_html/includes/modules/shipping/usps.php on line 428
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined offset: 7 in /home/UserName/public_html/includes/modules/shipping/usps.php on line 428
[09-Nov-2018 07:16:47 America/New_York] PHP Notice:  Undefined offset: 8 in /home/UserName/public_html/includes/modules/shipping/usps.php on line 428


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Anyone find a module that is compatible with USPS' new 1/27/2019 pricing updates?

Apparently; they are now charging for distance on USPS First Class postage.

On my site; the shipping module no longer seems to offer USPS First class as an option at all. Defaulting to Priority mail only.

Share this post


Link to post
Share on other sites

@zitt did you get anywhere with the first class issue? I've just had a report that it's charging too much for first class rather than not offering it.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

 

28 minutes ago, Dennisra said:

USPS shipping is now zone based so this add on does not work.

It may depend what services you offer. The report I had is that First Class isn't right but Priority Mail is ok.

I thought they already got the address through the interface - can't they work out where it is for themselves?

Or is the issue that format of the reponse from USPS has changed (again) and the module doesn't interpret it properly?


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

USPS shipping has always been zone based so this is not the cause of any problem you might be seeing. If one or more of the services are not working for you, turn on debugging in your Admin and look at the result.

Regards

Jim


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

Share this post


Link to post
Share on other sites

I beg to differ. First-Class Package Service - Retail was never zone based. Weight only. Now weight and one of 9 zones determines cost.

Share this post


Link to post
Share on other sites

"<Pounds>0</Pounds><Ounces>4</Ounces><FirstClassMailType>PACKAGE SERVICE RETAIL</FirstClassMailType><Size>REGULAR</Size><Machinable>FALSE</Machinable><Zone>1</Zone><Postage CLASSID="0"><MailService>First-Class Package Service -  Retail

https://pe.usps.com/text/dmm300/notice123.htm#_c038

 

https://www.pitneybowes.com/us/postal-information/usps-shipper.html

The following information lists USPS rate changes and pricing that take effect January 27, 2019. 

Changes to First-Class Packages:

New for 2019, the FCPS-Retail and FCPS Commercial price categories will have zone-based pricing.

Overall, First-Class Package Service prices will increase 12.3%, with a 13.3% increase for FCPS-Retail and an 11.9% increase for FCPS-Commercial.

Share this post


Link to post
Share on other sites

We give the USPS the From and To addresses and they calculate the cost based on that information. Exactly how they make those calculations are up to them. This i the way this interface has always worked.

Regards

Jim


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

Share this post


Link to post
Share on other sites

Has anyone else had an issue with the Debug emails? I have them turned on, and thew have worked fine for years. However, overnight, I have received over 20,000 debug emails!!!!

M


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

Hello all

I am moving from OSC 2.3.4.1 to OSC Phoenix. 

The specific module and vsn is  USPS Rate V4 Intl Rate V2_r1.8
Per kymation's reply in the topic - Which USPS add-on to use?!?
https://forums.oscommerce.com/topic/412353-which-usps-add-on-to-use/?tab=comments#comment-1764332

Since it was a CLEAN install I copied the files as directed.  This resulted in error code 500 server misconfiguration.  Putting back the ORIGINAL admin/modules.php returned me to normal.  So I began MANUAL modification.  When I attempted to incorporate the admin/modules.php modifications the identified FIND code does not appear in the module..  Since this is the case not incorporating the stated replace/add code is the cause for this issue. 

Since ALL of the identified FIND  code does NOT exist in the Phoenix module.php

The beginning portion does exist 

  if (tep_not_null($action)) {
    switch ($action) {
      case 'save':

However after that the coding is radically different.

Additionally I checked 

modules_actions.php 
modules_content.php
modules_hooks.php

modules_content.php also contains

  if (tep_not_null($action)) {
    switch ($action) {
      case 'save':

But yet again after that the coding is radically different.

As the attached screens show the module DOES install and is read by the PHOENIX code.  
the first image is the initial screen BEFORE any edit
the second is after editing and saving just the User ID

However, I have isolated it the fact that as soon as any value is edited and saved the 
Shipping Methods
Extra Services (domestic)
Extra Services (International)
simply show ARRAY

Since this is being setup on a LOCAL testing platform - I used phpAdmin to locate the values in my live store - copied and pasted them into the appropriate areas and the Front end does display the value albeit the amount is incorrect.

Additionally AFTER I did the copy and paste I noticed that the columns seemed to be off in the Admin as the TEXT from the values actually partially appears in the max weight value of the selected method.

In the db the configuration Table the field configuration_key and these values are the ones copied 
MODULE_SHIPPING_USPS_TYPES
MODULE_SHIPPING_USPS_DMST_SERVICES
MODULE_SHIPPING_USPS_INTL_SERVICES

The third graphic show  the values after the copy and paste.

HAS ANYONE SUCCEEDED in this endeavor?

BJ

 

1-Initial install.JPG

2-ID entered.JPG

3-after C&P.JPG

Share this post


Link to post
Share on other sites

The code in Phoenix has been updated, but the functionality is the same. The USPS module uses arrays to store the values you are having problems with. Stock osC does not handle arrays, so we need to make some changes to make that happen. The change to modules.php is a key part of that.

In Phoenix, find this code:

  if (tep_not_null($action)) {
    switch ($action) {
      case 'save':
        foreach ($_POST['configuration'] as $key => $value) {

and add this line immediately after that:

          if( is_array( $value ) )  $value = implode( ', ', $value );

That should fix the problems on the Admin side. You will need to uninstall and reinstall the module for this to work. I haven't tested this module with Phoenix, so there may be other changes needed.

Regards

Jim


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

Share this post


Link to post
Share on other sites
49 minutes ago, kymation said:

I haven't tested this module with Phoenix, so there may be other changes needed.

Thank you Jim.

I added the line where indicated and it SOLVED the problem.  Beyond that little change - everything went as advertised.  Comparing the LIVE store vs the Local store - the rates were pulled correctly.  The array now works.

Attached is a text file containing your code for addition in the download file.

THANKS again - onward and upward.  Any suggestions for the UPS shipping method?

Phoenix.txt

Edited by Chadduck

Share this post


Link to post
Share on other sites
1 hour ago, kymation said:

I haven't tested this module with Phoenix, so there may be other changes needed.

Jim

I was so excited that the array issue was resolved I was NOT paying attention on the Front End.

In the module  includes/modules/shipping/usps.php on line 32 is this

  $this->icon = DIR_WS_ICONS . 'shipping_usps.gif';

First there is NO icon in the package and secondly when Phoenix installs there is not a directory created.  Additionally there is no define set up in the configure.php for them.  As it appears there is a broken graphic that appears.  simply commenting that line out removes the broken graphic.

BJ

Share this post


Link to post
Share on other sites

@Chadduck
1) As you have identified, there is no shipping_usps.gif file in the add-on bundle. Fortunately, you already had one from a prior live store. For anyone else trying to get this to work with Phoenix, here's the file:

shipping_usps.gif.f2c608c0396926e9209eeaa0d077002c.gif

2) In the stock installation of Phoenix, there is no /images/icons folder. With that, there is also no DIR_WS_ICONS definition in the configuration file(s). To correctly use the shipping_usps.gif file, you need to:

a) Create a /images/icons folder

b) Copy the shipping_usps.gif file into this folder

c) In  includes/modules/shipping/usps.php , find

$this->icon = DIR_WS_ICONS . 'shipping_usps.gif';

and change it to:

$this->icon = 'images/icons/shipping_usps.gif';

Obviously, you could use any other folder you want to store the .gif file. Just update the path to point to the file's location.

 

If you did not have a copy of the shipping_usps.gif file, you could try to use the font awesome icon. The link Zahid gave above is wrong. His is a link to the UPS icon, not the USPS icon. The correct link is:

https://fontawesome.com/icons/usps?style=brands

However, the USPS module stores everything in an array (including the location of the icon), and I could not just substitute the Font Awesome link for the location of the .gif file.

HTH

M


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

(Phoenix 1.0.1.4)

A couple of questions ...

1) I have downloaded two different versions of this module. What is the difference between the V2_r1.8 and V2_r3.6 ?

It looks like @kymation updated the V2_r1.8 version in 2017 to address the First Class mail changes, but these changes are not in the V2_r3.6 version.

2) Does anyone have this working with the Ship in Cart 5.0 CE Phoenix add-on? I have both it and V2_r3.6 installed (I don't use First Class mail). Country drop-down= true, State drop-down = true, and ZIP Code input field = true. It does work, but ... for some countries, I get the multiple instances of the following error:

Warning: Invalid argument supplied for foreach() in C:\wamp64\www\m10\includes\modules\shipping\usps.php on line 132

The line in question is:

foreach ($Package['ExtraServices']['ExtraService'] as $key => $val) {

There are several other foreach statements throughout the module with the same syntax, so I don't see anything obviously wrong ...

TIA

Malcolm


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×