USPS Shipping Module

Help setting the module up - USPS Shipping Module

Help setting the module up

by tedukes » Wed Oct 27, 2021 11:36 pm

Trying to migrate from an older OSC version and just getting things setup.

I setup a dummy account and tried to checkout. The only option I see is the flat rate I installed to see if anything worked.

Not sure what this means:

You will need to have API USERID

details please visit www.usps.com/business/web-tools-apis/
THIS MOD ALSO REQUIRES PHP-XML TO BE INSTALLED ON SERVER

I have my user ID but what is the PHP-XML? Is there supposed to be a field to put in the USPS password?

Here's what's in the error log:

[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Undefined index: country_id in /home/vrj84iy0o0u3/public_html/shop/checkout_shipping.php on line 23
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Undefined index: country in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 697
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Trying to access array offset on value of type null in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 697
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Undefined index: country in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 708
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Trying to access array offset on value of type null in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 708
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Undefined index: country in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 709
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Trying to access array offset on value of type null in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 709
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Undefined index: country in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 712
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Trying to access array offset on value of type null in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 712
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Undefined index: country in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 714
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Trying to access array offset on value of type null in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 714
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Undefined index: country in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 716
[27-Oct-2021 23:46:16 Europe/London] PHP Notice: Trying to access array offset on value of type null in /home/vrj84iy0o0u3/public_html/shop/includes/modules/shipping/zipusps.php on line 716
[27-Oct-2021 23:46:16 Europe/London] PHP Warning: Invalid argument supplied for foreach() in /home/vrj84iy0o0u3/public_html/shop/includes/system/versioned/1.0.7.4/shipping.php on line 99

Not sure what else I can provide, I am stumped.

TIA
tedukes
Member
Posts: 87
Joined: Wed Oct 27, 2021 11:27 pm
Phoenix Version:
Contact:

Re: Help setting the module up

by zipurman » Wed Oct 27, 2021 11:55 pm

So in the module, make sure you set the following:

- Account Username
- Account Password
- Account Number
- Access KEY (API KEY FROM YOUR UPS API ACCOUNT)
- Origin City (Make sure it matches exactly to your city name)
- Origin State (Make sure it is the 2 letter for your state/prov example: AZ or FL etc.)
- Origin Country (Make sure it is the 2 letter for your country example: US or CA etc.)
- Origin Zip Code (Make sure it is accurate)

As for assigning to your customers, you will have to specify a Shipping Zone. You can read the Phoenix docs if you are not clear on how that works.

Also, make sure the Sort Order is unique and is not zero.

As for php-xml ... that is a php language module that needs to be installed. You can google "install php-xml on centos" where centos is the operating system. If you are using rhel or debian etc, search for that instead.

You could check to see what php xml modules you have installed by running the following on the command line:

php -m | grep xm

Hope that helps.
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Contact:

Re: Help setting the module up

by tedukes » Thu Oct 28, 2021 1:01 am

Thanks for the fast reply!!

Not seeing a field for the password or account number, just the USPS API Username.

Also, this is hosted on Godaddy. Am I screwed? I installed CE Phoenix from their installer from cPanel, so guessing it should work.

Thanks!!
tedukes
Member
Posts: 87
Joined: Wed Oct 27, 2021 11:27 pm
Phoenix Version:
Contact:

Re: Help setting the module up

by zipurman » Thu Oct 28, 2021 3:47 am

Sorry about that, I was referencing UPS and not USPS.

USPS API Username is the only authentication required field.

Make sure the City, State, Country, ZIP are all accurate as described above with 2 characters for State and Country. You must also have a matching Country Code and State Code in your Phoenix Install, which you should by default.

Also, make sure you check off the services you want to offer.

Make sure your complete your Shipping Zone and Tax Class(optional)

Sort order must be unique and cannot be zero.

As for godaddy and PHP:
https://ca.godaddy.com/help/enable-cust ... ules-12036
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Contact:

Re: Help setting the module up

by tedukes » Thu Oct 28, 2021 1:31 pm

Thanks!

I did check the php modules. Everything with XML are selected. There was not a module php-xml speically. As far as i know, I have everything setup correctly. Attached is a screen shot.

Do I need to contact USPS to "turn it on"? Seems I read something in an addon on oscommerce addon site.

Thanks
Attachments
FireShot Capture 067 - CE Phoenix Administration Tool - www.palmettoshopper.com.png
tedukes
Member
Posts: 87
Joined: Wed Oct 27, 2021 11:27 pm
Phoenix Version:
Contact:

Re: Help setting the module up

by tedukes » Thu Oct 28, 2021 3:10 pm

Also, could this be what I need? I get error 404 when I go there.

USPS Price Calc API (XML) (Zipur's Version)
https://phoenixaddons.com/knowledgebase ... ml-module/

thanks
tedukes
Member
Posts: 87
Joined: Wed Oct 27, 2021 11:27 pm
Phoenix Version:
Contact:

Re: Help setting the module up

by zipurman » Thu Oct 28, 2021 5:33 pm

The link you provided is really old, and that would not be needed anyway.

Try changing the state to the Full State Name. I know I said 2 letter, but that was for UPS mod and I just noticed this mod does not say 2 letters for State. If that doesn't work, email me directly at plord@inetx.ca and send me your test store URL and creds and I can have a look to get you going.

I don't think a call to USPS is needed as I was able to create an account and get it working when I wrote it without calling them at all.
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Contact:

Re: Help setting the module up

by zipurman » Fri Oct 29, 2021 4:16 am

I had a look at your store and the Customer Country was disabled. As a result, no country was specified by the user and that breaks things.

I re-enabled your country customer data field, edited my address, and I was able to see the USPS shipping.

;)
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Contact: