dzedward Posted February 23, 2011 Share Posted February 23, 2011 When a customer has an international address and is checking out, they are presented with a list of available USPS shipping options to choose from. The customer can select one, then continue to the order confirmation page. However, when the customer lands on the confirmation page - the shipping option they selected doesn't appear. If you change the shipping address to the US, the shipping option you select carries over to the confirmation page. Any ideas? We're running version: osCommerce 2.2-MS2. Quote Link to comment Share on other sites More sharing options...
hammershell Posted February 26, 2011 Share Posted February 26, 2011 USPS has recently changed some of their settings s in January breaking the INTERNATIONAL aspect of the module. It broke mine too. I will be fixing this and posting the code here since this is GPL software. OSCommerce 2.2 Quote Link to comment Share on other sites More sharing options...
Guest Posted March 4, 2011 Share Posted March 4, 2011 Hammershell, Have you posted the code to correct the USPS module? Quote Link to comment Share on other sites More sharing options...
hammershell Posted March 4, 2011 Share Posted March 4, 2011 Not yet. It seems after investigating so far that it is strictly an issue where after selecting the shipping rate, the XML is not being sent to USPS properly or it isn't being retrieved properly. I am guessing that it is wanting the title of the USPS method along with the extra HTML code that they are including in their method titles now. I am still looking at it. Quote Link to comment Share on other sites More sharing options...
dzedward Posted March 4, 2011 Author Share Posted March 4, 2011 Glad to hear you're working on it, thanks! Where would be posting the fix when you get it figured out, in this thread? Quote Link to comment Share on other sites More sharing options...
hammershell Posted March 4, 2011 Share Posted March 4, 2011 Te fix will be posted right here Quote Link to comment Share on other sites More sharing options...
dzedward Posted March 4, 2011 Author Share Posted March 4, 2011 Cool, thanks! Quote Link to comment Share on other sites More sharing options...
dzedward Posted March 7, 2011 Author Share Posted March 7, 2011 Hi hammershell, any luck at all? Quote Link to comment Share on other sites More sharing options...
hammershell Posted March 8, 2011 Share Posted March 8, 2011 Yes I have had good luck. There are some new USPS Methods as well here: All changes are made to the usps.php file only in the "includes/modules/shipping" folder Step #1: Comment out the previous USPS Method array and add this after it: /*$this->intl_types = array('Global Express Guaranteed', // edit 'Global Express Guaranteed Non-Document Rectangular', 'Global Express Guaranteed Non-Document Non-Rectangular', 'Express Mail International (EMS)', 'Express Mail International (EMS) Flat Rate Envelope', 'Priority Mail International', 'Priority Mail International Flat Rate Envelope', 'Priority Mail International Flat Rate Box', 'First-Class Mail International');*/ $this->intl_types = array( // old rates 'Global Express' => 'Global Express Guaranteed (GXG)**', 'Global Express Non-Doc Rect' => 'Global Express Guaranteed Non-Document Rectangular', 'Global Express Non-Doc Non-Rect' => 'Global Express Guaranteed Non-Document Non-Rectangular', 'USPS GXG Envelopes' => 'USPS GXG Envelopes**', 'Express Mail Int' => 'Express Mail International', 'Express Mail Int Flat Rate Env' => 'Express Mail International Flat Rate Envelope', 'Express Mail Int Legal' => 'Express Mail International Legal Flat Rate Envelope', 'Priority Mail International' => 'Priority Mail International', 'Priority Mail Int Flat Rate Lrg Box' => 'Priority Mail International Large Flat Rate Box', 'Priority Mail Int Flat Rate Med Box' => 'Priority Mail International Medium Flat Rate Box', 'Priority Mail Int Flat Rate Small Box' => 'Priority Mail International Small Flat Rate Box**', // new rates 'Priority Mail Int DVD' => 'Priority Mail International DVD Flat Rate Box**', 'Priority Mail Int Lrg Video' => 'Priority Mail International Large Video Flat Rate Box**', // old rates 'Priority Mail Int Flat Rate Env' => 'Priority Mail International Flat Rate Envelope**', // new rates 'Priority Mail Int Legal Flat Rate Env' => 'Priority Mail International Legal Flat Rate Envelope**', 'Priority Mail Int Padded Flat Rate Env' => 'Priority Mail International Padded Flat Rate Envelope**', 'Priority Mail Int Gift Card Flat Rate Env' => 'Priority Mail International Gift Card Flat Rate Envelope**', 'Priority Mail Int Small Flat Rate Env' => 'Priority Mail International Small Flat Rate Envelope**', // old rates 'First Class Mail Int Lrg Env' => 'First-Class Mail International Large Envelope**', 'First Class Mail Int Package' => 'First-Class Mail International Package**', 'First Class Mail Int Letter' => 'First-Class Mail International Letter**' ); Step #2: Right before the "$response = array();" line add the two $body statements // strip reg and trade out $body = str_replace('<sup>&reg;</sup>', '', $body); $body = str_replace('<sup>&trade;</sup>', '', $body); $response = array(); while (true) { if ($start = strpos($body, '<Package ID=')) { $body = substr($body, $start); $end = strpos($body, '</Package>'); $response[] = substr($body, 0, $end+10); $body = substr($body, $end+9); } else { break; } } It should work perfectly now. Enjoy :thumbsup: Quote Link to comment Share on other sites More sharing options...
dzedward Posted March 8, 2011 Author Share Posted March 8, 2011 thanks so much hammershell, works like a charm! Quote Link to comment Share on other sites More sharing options...
rdranch Posted March 9, 2011 Share Posted March 9, 2011 This worked for me also but I don't want to offer all the shipping methods that it gives. How do I limit it to just Priority and Express? I have tried deleting or making them into comments but obviously I'm not doing it in the right place. Quote Link to comment Share on other sites More sharing options...
hammershell Posted March 11, 2011 Share Posted March 11, 2011 This worked for me also but I don't want to offer all the shipping methods that it gives. How do I limit it to just Priority and Express? I have tried deleting or making them into comments but obviously I'm not doing it in the right place. Just wrap this if statement around this statement near the </SvcDescription> tag. You can add more methods as you like: if ($service != 'Priority Mail International DVD Flat Rate Box**') { $rates[] = array($service => $postage); } Quote Link to comment Share on other sites More sharing options...
rdranch Posted March 11, 2011 Share Posted March 11, 2011 Just wrap this if statement around this statement near the </SvcDescription> tag. You can add more methods as you like: if ($service != 'Priority Mail International DVD Flat Rate Box**') { $rates[] = array($service => $postage); } Quote Link to comment Share on other sites More sharing options...
rdranch Posted March 11, 2011 Share Posted March 11, 2011 Thank you, but can you tell me where I would put this exactly. And am I putting the services in here that I don't want? Appreciate your help. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 14, 2011 Share Posted March 14, 2011 Thanks Hammershell, but I'm getting errors. I loaded the complete file you sent me. When using a International address I get: Warning: Illegal offset type in /home/ridecool/public_html/catalog/includes/modules/shipping/usps.php on line 329 And when I select a US address I get: Warning: Illegal offset type in /home/ridecool/public_html/catalog/includes/modules/shipping/usps.php on line 293 Also the new file takes out the shipping options in the admin. Any suggestions? Quote Link to comment Share on other sites More sharing options...
hammershell Posted March 15, 2011 Share Posted March 15, 2011 (edited) Thank you, but can you tell me where I would put this exactly. And am I putting the services in here that I don't want? Appreciate your help. Yes, these are the services that you don't want. "!=" means 'not equal to' so it doesn't proceed to list that Service. First search your usps.php file for the term '</SvcDescription>.' A few lines after this term you will find the line '$rates[] = array($service => $postage);' Replace that line with: if ($service != 'Priority Mail International DVD Flat Rate Box**') { $rates[] = array($service => $postage); } Now you will remove any Service with the term -you list- that is in the $service variable. You can select from these services: Global Express Guaranteed (GXG)** Global Express Guaranteed Non-Document Rectangular Global Express Guaranteed Non-Document Non-Rectangular USPS GXG Envelopes** Express Mail International Express Mail International Flat Rate Envelope Express Mail International Legal Flat Rate Envelope Priority Mail International Priority Mail International Large Flat Rate Box Priority Mail International Medium Flat Rate Box Priority Mail International Small Flat Rate Box** Priority Mail International DVD Flat Rate Box** Priority Mail International Large Video Flat Rate Box** Priority Mail International Flat Rate Envelope** Priority Mail International Legal Flat Rate Envelope** Priority Mail International Padded Flat Rate Envelope** Priority Mail International Gift Card Flat Rate Envelope** Priority Mail International Small Flat Rate Envelope** First-Class Mail International Large Envelope** First-Class Mail International Package** First-Class Mail International Letter** For multiple Methods do it like this: if ($service != 'Priority Mail International DVD Flat Rate Box**' || $service != 'First-Class Mail International Letter**') { $rates[] = array($service => $postage); } Edited March 15, 2011 by hammershell Quote Link to comment Share on other sites More sharing options...
hammershell Posted March 15, 2011 Share Posted March 15, 2011 Thanks Hammershell, but I'm getting errors. I loaded the complete file you sent me. When using a International address I get: Warning: Illegal offset type in /home/ridecool/public_html/catalog/includes/modules/shipping/usps.php on line 329 And when I select a US address I get: Warning: Illegal offset type in /home/ridecool/public_html/catalog/includes/modules/shipping/usps.php on line 293 Also the new file takes out the shipping options in the admin. Any suggestions? This isn't happening for me. Can you resend the file to me and I will test it on my store? Quote Link to comment Share on other sites More sharing options...
rdranch Posted March 19, 2011 Share Posted March 19, 2011 Yes, these are the services that you don't want. "!=" means 'not equal to' so it doesn't proceed to list that Service. First search your usps.php file for the term '</SvcDescription>.' A few lines after this term you will find the line '$rates[] = array($service => $postage);' Replace that line with: if ($service != 'Priority Mail International DVD Flat Rate Box**') { $rates[] = array($service => $postage); } Now you will remove any Service with the term -you list- that is in the $service variable. You can select from these services: Global Express Guaranteed (GXG)** Global Express Guaranteed Non-Document Rectangular Global Express Guaranteed Non-Document Non-Rectangular USPS GXG Envelopes** Express Mail International Express Mail International Flat Rate Envelope Express Mail International Legal Flat Rate Envelope Priority Mail International Priority Mail International Large Flat Rate Box Priority Mail International Medium Flat Rate Box Priority Mail International Small Flat Rate Box** Priority Mail International DVD Flat Rate Box** Priority Mail International Large Video Flat Rate Box** Priority Mail International Flat Rate Envelope** Priority Mail International Legal Flat Rate Envelope** Priority Mail International Padded Flat Rate Envelope** Priority Mail International Gift Card Flat Rate Envelope** Priority Mail International Small Flat Rate Envelope** First-Class Mail International Large Envelope** First-Class Mail International Package** First-Class Mail International Letter** For multiple Methods do it like this: if ($service != 'Priority Mail International DVD Flat Rate Box**' || $service != 'First-Class Mail International Letter**') { $rates[] = array($service => $postage); } Quote Link to comment Share on other sites More sharing options...
rdranch Posted March 19, 2011 Share Posted March 19, 2011 I was unable to get it to work for multiple shipping methods as you did it. But I put the if statement for each one I didn't want and it is working. if ($service != 'First-Class Mail International Large Envelope**') if ($service != 'Global Express Guaranteed (GXG)**') if ($service != 'Global Express Guaranteed Non-Document Rectangular') Thank you so much. But now can you tell me where I do this for USPS domestic? I have a company that I normally pay to do this stuff if I can't do it myself but they are taking too long to get back to me and I need this changed asap. Plus it always makes me feel good to do it myself. Quote Link to comment Share on other sites More sharing options...
rdranch Posted March 19, 2011 Share Posted March 19, 2011 I was unable to get it to work for multiple shipping methods as you did it. But I put the if statement for each one I didn't want and it is working. if ($service != 'First-Class Mail International Large Envelope**') if ($service != 'Global Express Guaranteed (GXG)**') if ($service != 'Global Express Guaranteed Non-Document Rectangular') Thank you so much. But now can you tell me where I do this for USPS domestic? I have a company that I normally pay to do this stuff if I can't do it myself but they are taking too long to get back to me and I need this changed asap. Plus it always makes me feel good to do it myself. YEAH ME. I found it myself. This is what I did: $this->types = array('EXPRESS' => 'Express Mail', /*'FIRST CLASS' => 'First-Class Mail',*/ 'PRIORITY' => 'Priority Mail', 'PARCEL' => 'Parcel Post'); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.