Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Guest

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.

Link to comment
Share on other sites

  • 2 months later...

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.

Link to comment
Share on other sites

  • 1 month later...

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

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
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?

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...

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://www.oscommerce.com/forums/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

Link to comment
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.

Link to comment
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
Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • 1 month later...

The US Post Office seems to require insurance for international order valued over $200 (why I have to pay extra for insurance to have them do their job is another subject). I don't show insurance as an option, as most people probably won't select it.

Is there a way to have this module to automatically add insurance for international orders over $200?

TIA

Malcolm

Link to comment
Share on other sites

  • 4 weeks later...

OK - got past the modules.php thing and have it installed in Phoenix 1.0.4.0 (thanks, Kymation!).  In Admin, everything looks fine.

However, USPS shipping won't even appear in the checkout.  I set the Debug e-mail and apparently, the USPS server has no idea where my store is located.  In previous versions of oscommerce, this was set in the Configuration->Shipping/Packaging, which included items in the list for "Country of Origin" and "Postal Code."  These items are not available in the Admin->Configuration->Shipping/Packaging for Phoenix (might also be why I could never make USPS work for any CE version).

Where can I set my store's zip code so that the USPS server can respond with shipping rates?

Link to comment
Share on other sites

"These items are not available in the Admin->Configuration->Shipping/Packaging for Phoenix (might also be why I could never make USPS work for any CE version)."

Unless I'm missing something, there's no zipcode entry in any of these:

Shipping/Packaging pixel_trans.gif
Title Value Action 
Enter the Maximum Package Weight you will ship 35 icon_arrow_right.gif 
Package Tare weight. 3 Info 
Larger packages - percentage increase. 10 Info 
Allow Orders Not Matching Defined Shipping Zones False Info 

 

(sloppy cut and paste)

Edited by TomB01
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...