Jump to content

USPS Mod - International Shipping Problems?


Guest

Recommended Posts

Hi. I have searched for anyone else having this problem but I haven't found any related topics to this so here I go:

If a customer is not in the USA, but order anything from my site, their shipping options looks strange and confusing to them (As the customer being myself since I have not fully upgraded my CC2 site to CC3.).

It is as if either the USPS is requesting the same quote information 4 times...or the USPS mod is receiving the results from the USPS server, but then arraying them 4 times over. Thus we have the Shipping options are shown 4 times, as shown in my pic here:

International_Error_Shown.png

Also to note, my Domestic Shipping rates and options are fine and only display each available option once. This issue only happens on the international shipping and for every country.

Is anyone else getting this problem? I've been poking through the code but I'm still waiting for the PHP gods to let me understand this stuff, so I have not figured it out yet. Thanks!

Link to comment
Share on other sites

So far I have not been having any luck with stopping my international rates from being shown 4 times over. I have been trying all sorts of code changes to at least help try and identify the area that is repeating the function 4 times... Ugh... But now all the code is looking crazy in my head.

I think I can add in something in the calc.php file like a filter that will not let repeated values go through, but I really need to stop the code from getting the international rates 4 times since some of the returned data is very large and it slows down the whole cart at that point.

Is there anyone that is using the USPS shipping module, and allows international orders that might be able to do a quick test on their site? I'l just looking to see if when you have an international customer, does your international rates show 4 times (Like mine in the above post) or just once?

Thanks for any help anyone can provide on this.

-Tim

Link to comment
Share on other sites

  • 3 weeks later...
Guest mashurst

So far I have not been having any luck with stopping my international rates from being shown 4 times over. I have been trying all sorts of code changes to at least help try and identify the area that is repeating the function 4 times... Ugh... But now all the code is looking crazy in my head.

I think I can add in something in the calc.php file like a filter that will not let repeated values go through, but I really need to stop the code from getting the international rates 4 times since some of the returned data is very large and it slows down the whole cart at that point.

Is there anyone that is using the USPS shipping module, and allows international orders that might be able to do a quick test on their site? I'l just looking to see if when you have an international customer, does your international rates show 4 times (Like mine in the above post) or just once?

Thanks for any help anyone can provide on this.

-Tim

mine doesn't duplicate post it like the example, it only lists it once, but it does do what yours is doing, which is list every possible usps shipping option, instead of the ones I just want to use which are global priority and airmail letter post. instead, it lists express, document service and all of the ones that I don't want.

but, I only have mine set up on priority mail. all of the other options i have disabled. I think maybe when I had more than one service enabled, it duplicated like you have. you prob have already tried this but just switch one of them on, priority mail flat rate envelope large and disable all of the other shipping options and then try it.

and, if anybody knows how to filter the usps results to only show the methods that you want instead of the entire shipping assortment of services for usps, i would love to know.

-m

Link to comment
Share on other sites

Yes that was exactly the problem. If you have more than one option enabled then it will duplicate the international shipping options. I right now have First Class, Priority, Express, and Parcel all enabled and that is why I was getting the thing above shown with the shipping methods listed 4 times.

What I did to fix that was just set the USPS settings just to enable on Parcel Post (Allows the most weight to ship). Then I copied what was in the database 'CONFIG' section for USPS into a new config table called 'USPSINT'. Next, went back and re-enabled all 4 of my shipping options for regular USPS. Then I modified the USPS/Calc.php file a bit to select which table to get the configuration from...So now the beginning of the calc.php file looks like this:

<?php

/* Demo code for the USPS class, which retrieves real-time shipping quotes for domestic and international shipments, directly from the United States Postal Service. You'll need cURL and DOMXML to use the class. IT DOES NOT WORK WITH PHP 5 */

	

require "class.usps.php";



//Modified Code by Tim Hensel



if($basket['delInf']['country']!==$config['siteCountry']) {

		$api = "IntlRate";

	} else {

		 $api = "RateV2";

	}



if($api=="IntlRate") {

	$module = fetchDbConfig("USPSINT");

	} else {

	$module = fetchDbConfig("USPS");

	}

Took some time to figure it out of what was going on but it's under control now. :blink:

Link to comment
Share on other sites

  • 5 months later...
Guest rebeccalea

Can anyone explain what this means in Tim's post:

Then I copied what was in the database 'CONFIG' section for USPS into a new config table called 'USPSINT'.

Trying to do this one last "fix."

Would appreciate getting rid of the duplicates too.

Link to comment
Share on other sites

Hi Rebecca,

Sorry for the unclear explaination for that USPS fix.

What I did was create a new field called 'USPSINT' under the 'CONFIG' table in the CubeCart database. It is basically just a duplicate of the 'USPS' field already in there.

I used phpMyAdmin and enter this SQL command:

CREATE TABLE `CubeCart_config` (

  `name` varchar(100) NOT NULL default '',

  `array` text NOT NULL,

  KEY `name` (`name`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;


Then insert this SQL command:


INSERT INTO `CubeCart_config` VALUES ('USPSINT', 'a:25:{s:16:"dGVzdHNwYXNzZWQ=";s:4:"MQ==";s:8:"dGVzdA==";s:4:"MA==";s:20:"c2VydmljZV9FeHByZXNz";s:4:"MA==";s:24:"c2VydmljZV9Qcmlvcml0eQ==";s:4:"MA==";s:24:"c2VydmljZV9GaXJzdENsYXNz";s:4:"MA==";s:8:"c3RhdHVz";s:4:"MQ==";s:8:"ZGVidWc=";s:4:"MA==";s:16:"ZXhwcmVzc1NpemU=";s:12:"UkVHVUxBUg==";s:24:"ZXhwcmVzc0NvbnRhaW5lcg==";s:20:"Tm9uLUZsYXQgUmF0ZQ==";s:20:"Rmlyc3RDbGFzc1NpemU=";s:12:"UkVHVUxBUg==";s:16:"cHJpb3JpdHlTaXpl";s:12:"UkVHVUxBUg==";s:24:"cHJpb3JpdHlDb250YWluZXI=";s:20:"Tm9uLUZsYXQgUmF0ZQ==";s:24:"c2VydmljZV9QYXJjZWwtTQ==";s:4:"MQ==";s:16:"cGFyY2VsLU1TaXpl";s:12:"UkVHVUxBUg==";s:24:"c2VydmljZV9QYXJjZWwtTk0=";s:4:"MA==";s:20:"cGFyY2VsLU5NU2l6ZQ==";s:12:"UkVHVUxBUg==";s:16:"c2VydmljZV9CUE0=";s:4:"MA==";s:12:"QlBNU2l6ZQ==";s:12:"UkVHVUxBUg==";s:20:"c2VydmljZV9MaWJyYXJ5";s:4:"MA==";s:16:"TGlicmFyeVNpemU=";s:12:"UkVHVUxBUg==";s:20:"c2VydmljZV9NZWRpYQ==";s:4:"MA==";s:12:"TWVkaWFTaXpl";s:12:"UkVHVUxBUg==";s:16:"emlwX29yaWdpbg==";s:8:"MDgwODk=";s:12:"dXNlcm5hbWU=";s:16:"NDk2SkFNTUE4MzMx";s:12:"cGFzc3dvcmQ=";s:16:"Mjg3V044NEtQMTM4";}');

Hopefully then it should show your new USPSINT field under the Config table.

Then you would just need to modify your USPS/Calc.php file to load in the 'USPSINT' data when your shipping international.

I hope this helps!

-Tim

Link to comment
Share on other sites

  • 10 months later...
Guest Boniknik

Thanks for this tip Tim! I have been searching all forums for the solution to this problem:rolleyes:, your solution worked for me! Thanks a lot for sharing! :)

Link to comment
Share on other sites

  • 9 months later...
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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