Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Guest

Recommended Posts

Jim,

 

I played with it some more. When I added more weight to the product like you suggested, it did increase the cost without affecting the UPS XML rates. So, i just bumped the weight from 8lbs. to 25lbs. and after testing, that looks like it got the costs closer.

 

The USPS XML module DOES go on dimensions. There is an option to turn that on and off too.

 

Thanks yet again for the help!

 

Nick

Link to comment
Share on other sites

This worked for me to get back International Rates but I get the following warning. There are several of them. Looks like one for each rate. I just posted 3.

 

Warning: Invalid argument supplied for foreach() in/home/XXXXX/public_html/includes/modules/shipping/usps.php on line 110

 

Warning: Invalid argument supplied for foreach() in/home/XXXXX/public_html/includes/modules/shipping/usps.php on line 110

 

Warning: Invalid argument supplied for foreach() in/home/XXXXX/public_html/includes/modules/shipping/usps.php on line 110

 

Curious if you've also disabled the Extra Services from the module's admin section. They should all be checkmarked to N instead of Y for both domestic and international.

 

I also recommend setting Show International Regulations to False.

 

I also just got this error about 20 min ago when testing for international order via USPS.

 

All my Extra services for domestic and international are set to N and Show International Regulations are set to False.

 

Warning: Invalid argument supplied for foreach() in

/home/x/x/x/includes/modules/shipping/usps.php on line

110

 

Using the latest and greates usps.php code Kymation.

 

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

Edited by npiazza77
Link to comment
Share on other sites

Here's a quick patch that should stop that error. Find this code:

 

	 foreach ($Package['ExtraServices']['ExtraService'] as $key => $val) {
	 if (isset ($iExtras[$val['ServiceName']]) && tep_not_null($iExtras[$val['ServiceName']]) && ((MODULE_SHIPPING_USPS_RATE_TYPE == 'Online' && $val['AvailableOnline'] == 'True') || (MODULE_SHIPPING_USPS_RATE_TYPE == 'Retail' && $val['Available'] == 'True'))) {
		 $val['ServiceAdmin'] = $iExtras[$val['ServiceName']];
		 $Services[] = $val;
	 }
	 }

 

and replace with this:

 

	  if( is_array( $Package['ExtraServices']['ExtraService'] ) ) {
		foreach ($Package['ExtraServices']['ExtraService'] as $key => $val) {
		  if (isset ($iExtras[$val['ServiceName']]) && tep_not_null($iExtras[$val['ServiceName']]) && ((MODULE_SHIPPING_USPS_RATE_TYPE == 'Online' && $val['AvailableOnline'] == 'True') || (MODULE_SHIPPING_USPS_RATE_TYPE == 'Retail' && $val['Available'] == 'True'))) {
			$val['ServiceAdmin'] = $iExtras[$val['ServiceName']];
			$Services[] = $val;
		  }
		}
	  }

 

Thanks for the bug report.

 

Regards

Jim

Edited by kymation

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

Link to comment
Share on other sites

Hello Jim,

 

I’m trying to figure out what’s going wrong when I install your USPS shipping module found here: http://www.oscommerce.com/forums/topic/383307-usps-rate-v4-intl-rate-v2-official-support-thread/page__st__560#entry1676958

 

Every time that I install and configure the module, I get the following error on my checkout_shipping.php page:

 

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : String not closed expecting " or ' in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: <?xml version="1.0",encoding="UTF-8"?> in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Blank needed here in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: <?xml version="1.0",encoding="UTF-8"?> in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : parsing XML declaration: '?>' expected in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: <?xml version="1.0",encoding="UTF-8"?> in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Do you have any idea how to fix these?

 

I am completely stuck.

 

Thank you in advance,

Brett

Link to comment
Share on other sites

Hello Jim,

 

I’m trying to figure out what’s going wrong when I install your USPS shipping module found here: http://www.oscommerce.com/forums/topic/383307-usps-rate-v4-intl-rate-v2-official-support-thread/page__st__560#entry1676958

 

Every time that I install and configure the module, I get the following error on my checkout_shipping.php page:

 

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : String not closed expecting " or ' in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: <?xml version="1.0",encoding="UTF-8"?> in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Blank needed here in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: <?xml version="1.0",encoding="UTF-8"?> in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : parsing XML declaration: '?>' expected in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: <?xml version="1.0",encoding="UTF-8"?> in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 312

 

Do you have any idea how to fix these?

 

I am completely stuck.

 

Thank you in advance,

Brett

 

Brett,

 

Make sure you are implementing the LATEST code found here: http://addons.oscommerce.com/info/8702

 

You need to save you configuration settings, uninstall the module, and then re-install it. If you do not have MVS installed, make sure you are uploading the correct usps.php file Jim placed in the 'New_Files\includes\modules\shipping' directory.

 

Nick

Edited by npiazza77
Link to comment
Share on other sites

Brett,

 

Make sure you are implementing the LATEST code found here: http://addons.oscommerce.com/info/8702

 

You need to save you configuration settings, uninstall the module, and then re-install it. If you do not have MVS installed, make sure you are uploading the correct usps.php file Jim placed in the 'New_Files\includes\modules\shipping' directory.

 

Nick

 

Thank you for the updated link, I will try this install and let you know if it works.

 

Brett

Link to comment
Share on other sites

Everything seems to be working except I am still getting the following error:

 

 

Warning: Value is not properly chunk encoded in /home/XXXXX/public_html/shop/includes/modules/shipping/usps.php on line 649

 

Other than that, the module seems to be correctly calculating rates

 

United States Postal Service 5 lbs, 0 oz

 

Priority Mail $21.20

Priority Mail Express $56.50

 

Can I just get someone to help that one final error please? Then I will be all set, and thank you all very much!

 

Brett

Edited by KVA Brett
Link to comment
Share on other sites

That's not the latest version. Make sure you have the latest, then remove and reinstall the module. And don't set the Max limit for First Class to less than 1 or it will fail.

 

Regards

Jim

 

Of all the stuff I tried and tried, the one thing that I completely missed was to remove and reinstall the module, operator error. Everything is 100% now, thanks a million.

 

Just curious. When did they change the 1st-Class option? I last updated the module for my friends store, before the fix file from the 14th, around the first of the year changes and he was still getting 1st-Class quotes as late as Sept 12th, looking back at past orders.

Link to comment
Share on other sites

The USPS changed their API in January and July. Some quotes continued to work after each change, but the affected quotes stopped showing. I don't remember exactly which quotes were affected by each change. It's complex.

 

They made another, unannounced change on 9 November, and we still haven't completely recovered from that one. I may wait for the January 2014 changes to tackle the whole mess again. Or just finish writing that new module.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

Evening all,

 

I am running v2.3.3.4. I have installed this add on twice (carefully double checked my manual changes each time), and each time when I click on the 'install module' button on the admin panel to access the module, I get this error:

 

Fatal error: Cannot redeclare http_chunked_decode() in /home/bltshop/public_html/shop/includes/modules/shipping/usps.php on line 658

 

I didn't see this addressed on this topic - can anyone help me out? If this has already been addressed, if you could just point me to the discussion.

 

Thanks so much!

 

JoAnne

Link to comment
Share on other sites

It's possible that you already have that function installed. Edit includes/modules/shipping/usps.php and find this near the bottom:

 

 /**
  * dechunk an http 'transfer-encoding: chunked' message

 

Delete that code and everything from that point to the final ?>.

 

Regards

Jim

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

Link to comment
Share on other sites

I'm still having some difficulties with this add on. I was able to install it through my admin panel; I selected the services I wanted, but my shop is not showing any usps shipping options. Also, there is no field to allow me to enter my usps password - isn't this needed?

 

Any help will be greatly appreciated.

 

JoAnne

Link to comment
Share on other sites

Check that you have a valid postal code in your Admin >> Configuration >> Shipping/Packaging. Try selecting all of the services, then turn off the ones you don't want once you are getting quotes.

 

Your USPS password is not needed to get quotes, so this module doesn't ask for it.

 

Regards

Jim

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

Link to comment
Share on other sites

First - many thanks to Jim for making this addon available. It is fantastic!

 

If anyone can help, I'm dealing with a minor challenge - a few of the shipping options I have selected in the admin panel are not showing up on the checkout page; e.g. Priority R/R Box A and B and (more importantly) Priority International Small Flat Rate Box.

 

In case you haven't guessed it yet, I am fairly php illiterate. Is there a fix for this; an area in the code I can check for a syntax error, etc. I wasn't able to find this specific issue in previous discussions. If it is previously addressed, just point me in the right direction.

 

Thanks so much.

 

running 2.3.3.4

Link to comment
Share on other sites

Some services are restricted, so you may not get them to all locations. Try getting a quote from the USPS website. If that doesn't return your services, they're just not available. If they do work there, it's a bug in the module.

 

Regards

Jim

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

Link to comment
Share on other sites

Hi Jim,

 

Checked - the services are available for the locations, so there might be a small bug somewhere. I'll try walking through the code later and see if I can find a discrepancy between what is working and what is not that might be the cause. None of this is a show stopper.

 

Thanks for the quick response!

 

JoAnne

Link to comment
Share on other sites

Some of the less-common services didn't get tested, so there may still be bugs. I'm working on a new module that won't have most of these problems, so this one only gets fixed if someone finds a bug.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 weeks later...

I've updated the module to comment out the warning about improperly chunked response from USPS. Apparently this happens a lot. Anyway, don't bother to upgrade if yours is working; it's just a cosmetic fix.

 

Regards

Jim

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

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