Guest Posted May 15, 2007 Share Posted May 15, 2007 READ this: http://www.usps.com/ratecase/simplified_in...ional_rates.htm Note, that on May 14th the USPS International Shipping Names changed for USPS. -- File: /includes/modules/shipping/usps.php around line 49 look for: $this->intl_types = array NOW what to do as I have tried several different string changes but can only get "Priority Mail International" to work and show up easily, but for some reason I can NOT get "Express Mail International" to show up. :huh: HELP? What should I do or what OTHER files do I need to change? Quote Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2007 Share Posted May 16, 2007 Fixed it. Realize I only use USPS International Express for International packages. Anyway I changed the USPS.php file about line 50: $this->intl_types = array( 'Express Mail Int' => 'Express Mail International (EMS)'); Problem fixed. Now if you want all USPS International services then just change it to this: $this->intl_types = array( 'Global Express' => 'Global Express Guaranteed', 'Global Express Non-Doc Rect' => 'Global Express Guaranteed Non-Document Rectangular', 'Global Express Non-Doc Non-Rect' => 'Global Express Guaranteed Non-Document Non-Rectangular', 'Express Mail Int' => 'Express Mail International (EMS)', 'Express Mail Int Flat Rate Env' => 'Express Mail International (EMS) Flat Rate Envelope', 'Priority Mail Int' => 'Priority Mail International', 'Priority Mail Int Flat Rate Env' => 'Priority Mail International Flat Rate Envelope', 'Priority Mail Int Flat Rate Box' => 'Priority Mail International Flat Rate Box', 'First-Class Mail Int' => 'First-Class Mail International'); Quote Link to comment Share on other sites More sharing options...
mrichards Posted May 16, 2007 Share Posted May 16, 2007 Can you elaborate on all the changes you made? I did the what you suggested and nothing came up at checkout. Quote Link to comment Share on other sites More sharing options...
ikishk Posted May 16, 2007 Share Posted May 16, 2007 Can you elaborate on all the changes you made? I did the what you suggested and nothing came up at checkout. catalog/includes/modules/shipping/usps.php line 49 should be replaced with (find the line with $this->intl_types): $this->intl_types = array( 'Global Express' => 'Global Express Guaranteed', 'Global Express Non-Doc Rect' => 'Global Express Guaranteed Non-Document Rectangular', 'Global Express Non-Doc Non-Rect' => 'Global Express Guaranteed Non-Document Non-Rectangular', 'Express Mail Int' => 'Express Mail International (EMS)', 'Express Mail Int Flat Rate Env' => 'Express Mail International (EMS) Flat Rate Envelope', 'Priority Mail Int' => 'Priority Mail International', 'Priority Mail Int Flat Rate Env' => 'Priority Mail International Flat Rate Envelope', 'Priority Mail Int Flat Rate Box' => 'Priority Mail International Flat Rate Box', 'First-Class Mail Int' => 'First-Class Mail International'); catalog/includes/modules/shipping/usps.php line 169 should be replaced with (find the line with MODULE_SHIPPING_USPS_TYPES_INTL): tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Int\'l Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES_INTL', 'Global Express, Global Express Non-Doc Rect, Global Express Non-Doc Non-Rect, Express Mail Int, Express Mail Int Flat Rate Env, Priority Mail Int, Priority Mail Int Flat Rate Env, Priority Mail Int Flat Rate Box, First-Class Mail Int', 'Select the international services to be offered:', '6', '15', 'tep_cfg_select_multioption(array(\'Global Express\', \'Global Express Non-Doc Rect\', \'Global Express Non-Doc Non-Rect\', \'Express Mail Int\', \'Express Mail Int Flat Rate Env\', \'Priority Mail Int\', \'Priority Mail Int Flat Rate Env\', \'Priority Mail Int Flat Rate Box\', \'First-Class Mail Int\'), ', now())"); Using phpmyadmin or cli mysql you need to update the "configuration table." Do a select to find the configuration_id: SELECT configuration_id from configuration where configuration_key = "MODULE_SHIPPING_USPS_TYPES_INTL"; Now update the table using that result: UPDATE `configuration` SET `configuration_value` = 'Global Express, Global Express Non-Doc Rect, Global Express Non-Doc Non-Rect, Express Mail Int, Express Mail Int Flat Rate Env, Priority Mail Int, Priority Mail Int Flat Rate Env, Priority Mail Int Flat Rate Box, First-Class Mail Int', `last_modified` = NULL , `use_function` = NULL , `set_function` = 'tep_cfg_select_multioption(array(\'Global Express\', \'Global Express Non-Doc Rect\', \'Global Express Non-Doc Non-Rect\', \'Express Mail Int\', \'Express Mail Int Flat Rate Env\', \'Priority Mail Int\', \'Priority Mail Int Flat Rate Env\', \'Priority Mail Int Flat Rate Box\', \'First-Class Mail Int\'),' WHERE `configuration_id` = 'insert_id_from_query_above' LIMIT 1; if that works for ya, do you know why im getting a "request time out" on google checkout?:) Quote Link to comment Share on other sites More sharing options...
mrichards Posted May 16, 2007 Share Posted May 16, 2007 catalog/includes/modules/shipping/usps.php line 49 should be replaced with (find the line with $this->intl_types): $this->intl_types = array( 'Global Express' => 'Global Express Guaranteed', 'Global Express Non-Doc Rect' => 'Global Express Guaranteed Non-Document Rectangular', 'Global Express Non-Doc Non-Rect' => 'Global Express Guaranteed Non-Document Non-Rectangular', 'Express Mail Int' => 'Express Mail International (EMS)', 'Express Mail Int Flat Rate Env' => 'Express Mail International (EMS) Flat Rate Envelope', 'Priority Mail Int' => 'Priority Mail International', 'Priority Mail Int Flat Rate Env' => 'Priority Mail International Flat Rate Envelope', 'Priority Mail Int Flat Rate Box' => 'Priority Mail International Flat Rate Box', 'First-Class Mail Int' => 'First-Class Mail International'); catalog/includes/modules/shipping/usps.php line 169 should be replaced with (find the line with MODULE_SHIPPING_USPS_TYPES_INTL): tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Int\'l Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES_INTL', 'Global Express, Global Express Non-Doc Rect, Global Express Non-Doc Non-Rect, Express Mail Int, Express Mail Int Flat Rate Env, Priority Mail Int, Priority Mail Int Flat Rate Env, Priority Mail Int Flat Rate Box, First-Class Mail Int', 'Select the international services to be offered:', '6', '15', 'tep_cfg_select_multioption(array(\'Global Express\', \'Global Express Non-Doc Rect\', \'Global Express Non-Doc Non-Rect\', \'Express Mail Int\', \'Express Mail Int Flat Rate Env\', \'Priority Mail Int\', \'Priority Mail Int Flat Rate Env\', \'Priority Mail Int Flat Rate Box\', \'First-Class Mail Int\'), ', now())"); Using phpmyadmin or cli mysql you need to update the "configuration table." Do a select to find the configuration_id: SELECT configuration_id from configuration where configuration_key = "MODULE_SHIPPING_USPS_TYPES_INTL"; Now update the table using that result: UPDATE `configuration` SET `configuration_value` = 'Global Express, Global Express Non-Doc Rect, Global Express Non-Doc Non-Rect, Express Mail Int, Express Mail Int Flat Rate Env, Priority Mail Int, Priority Mail Int Flat Rate Env, Priority Mail Int Flat Rate Box, First-Class Mail Int', `last_modified` = NULL , `use_function` = NULL , `set_function` = 'tep_cfg_select_multioption(array(\'Global Express\', \'Global Express Non-Doc Rect\', \'Global Express Non-Doc Non-Rect\', \'Express Mail Int\', \'Express Mail Int Flat Rate Env\', \'Priority Mail Int\', \'Priority Mail Int Flat Rate Env\', \'Priority Mail Int Flat Rate Box\', \'First-Class Mail Int\'),' WHERE `configuration_id` = 'insert_id_from_query_above' LIMIT 1; if that works for ya, do you know why im getting a "request time out" on google checkout?:) Thanks so much for the info, I think I found the issue, we don't have the: "MODULE_SHIPPING_USPS_TYPES_INTL"; We had modifications done and that is not showing anywhere for me :( Quote Link to comment Share on other sites More sharing options...
ikishk Posted May 16, 2007 Share Posted May 16, 2007 Thanks so much for the info, I think I found the issue, we don't have the: "MODULE_SHIPPING_USPS_TYPES_INTL"; We had modifications done and that is not showing anywhere for me :( Thats part of a mod that allows you to chose which usps methods to offer, its not in the original usps.php, sorry i didnt specify. Quote Link to comment Share on other sites More sharing options...
mrichards Posted May 16, 2007 Share Posted May 16, 2007 Thats part of a mod that allows you to chose which usps methods to offer, its not in the original usps.php, sorry i didnt specify. So then this won't work for us? Quote Link to comment Share on other sites More sharing options...
ikishk Posted May 16, 2007 Share Posted May 16, 2007 So then this won't work for us? It should minus the parts you didnt find :) as long as you edited that first array, it shoudl work. that other stuff is for backend admin UI manipulation, not rate fetching functionality. Quote Link to comment Share on other sites More sharing options...
mrichards Posted May 16, 2007 Share Posted May 16, 2007 It should minus the parts you didnt find :) as long as you edited that first array, it shoudl work. that other stuff is for backend admin UI manipulation, not rate fetching functionality. I did edit the first array and it did come up, would I still need to add the other part in PHPMyadmin? Quote Link to comment Share on other sites More sharing options...
ikishk Posted May 16, 2007 Share Posted May 16, 2007 I did edit the first array and it did come up, would I still need to add the other part in PHPMyadmin? nope, that sql stuff relates to the other mod. Quote Link to comment Share on other sites More sharing options...
mrichards Posted May 16, 2007 Share Posted May 16, 2007 nope, that sql stuff relates to the other mod. Hm I wonder what I am doing wrong then. Quote Link to comment Share on other sites More sharing options...
jderouen Posted May 17, 2007 Share Posted May 17, 2007 It's not working for me either. Right now, when an international customer tries to check out, s/he sees this: An error occured with the USPS shipping calculations. If you prefer to use USPS as your shipping method, please contact the store owner. I made this change: $this->intl_types = array( 'Global Express' => 'Global Express Guaranteed', 'Global Express Non-Doc Rect' => 'Global Express Guaranteed Non-Document Rectangular', 'Global Express Non-Doc Non-Rect' => 'Global Express Guaranteed Non-Document Non-Rectangular', 'Express Mail Int' => 'Express Mail International (EMS)', 'Express Mail Int Flat Rate Env' => 'Express Mail International (EMS) Flat Rate Envelope', 'Priority Mail Int' => 'Priority Mail International', 'Priority Mail Int Flat Rate Env' => 'Priority Mail International Flat Rate Envelope', 'Priority Mail Int Flat Rate Box' => 'Priority Mail International Flat Rate Box', 'First-Class Mail Int' => 'First-Class Mail International'); But it's still not working. What else do I need to do? Thanks, Joe Quote Link to comment Share on other sites More sharing options...
itztba Posted May 17, 2007 Share Posted May 17, 2007 A few of my customers asked me about this issue today, and I want this fixed - I did the first array and the line for the db, without success!! Please advise Quote Link to comment Share on other sites More sharing options...
ramstainedglass Posted May 21, 2007 Share Posted May 21, 2007 Itztba or anyone else: Where did you get the replacement code for the whole new USPS module page? Could you please provide a link for me? I have no idea how to begin making the change from the last official milestone's version. Ruth Quote Link to comment Share on other sites More sharing options...
thischarmingham Posted May 25, 2007 Share Posted May 25, 2007 Itztba or anyone else: Where did you get the replacement code for the whole new USPS module page? Could you please provide a link for me? I have no idea how to begin making the change from the last official milestone's version. Ruth I'd like this info as well. Here's whats happening with me right now... I edited that first array and it fixed the intial problem. I also edited out some options and it knocks out the functionality of any of the shipping options I edited out which is great. I don't want the customer to have 10 different international shipping options. They often choose the cheapest that doesn't apply to the size of the thing they're ordering. Anyway the fuctionality of those things is gone but they're still listed in the check out which isn't cool. If a customer chooses an option that doesn't work any more it automatically gives them the most expensive option which isn't what I want either. In the end I need to know how to remove those options entirely. Quote Link to comment Share on other sites More sharing options...
fum Posted May 26, 2007 Share Posted May 26, 2007 So I've added in the new types, and it's presently not working. Here's what my initial research shows. It appears as if the usps quotes are coming back correctly from the usps server ( I turned on debug, and looked at the response), but my first inclination is that the array that sets the $allowed_types is no longer being set correctly. What leads me here is that when I go into configure the modules, the options for user and password, zone, and test/production seem to be working, but none of the check boxes for the shipping types seem to hold their values. With these values not being read out of the database correctly by the admin module, the shipping module is likely the same, so when it processes the results, ends up with no shipping quotes, because it doesn't find any that have been configured. I did verify that the correct options were changed out in the usps.php, and that I have the tep_cfg_select_multioption added in the general.php file, as well as the alter statement on the configuration table to make the set_function field allow more than 255 chars. I did note that the field type has now been changed to text, and I'm unsure if mysql requires different handling of varchar2 vs. text fields. I'm focusing in on tep_cfg_select_multioption and appropriate code in usps.php to see if I can get it up and running again, but thought I'd post my findings here, in case it helps others. Regards ju Quote Link to comment Share on other sites More sharing options...
fum Posted May 26, 2007 Share Posted May 26, 2007 duh, figured it out. was missing the proper admin/modules.php. all happy now. :rolleyes: Quote Link to comment Share on other sites More sharing options...
jadeb Posted May 30, 2007 Share Posted May 30, 2007 I'd like this info as well. Here's whats happening with me right now... I edited that first array and it fixed the intial problem. I also edited out some options and it knocks out the functionality of any of the shipping options I edited out which is great. I don't want the customer to have 10 different international shipping options. They often choose the cheapest that doesn't apply to the size of the thing they're ordering. Anyway the fuctionality of those things is gone but they're still listed in the check out which isn't cool. If a customer chooses an option that doesn't work any more it automatically gives them the most expensive option which isn't what I want either. In the end I need to know how to remove those options entirely. Hi thischarmingham, I wonder if you've got an update on this problem? I've got the exact same issue (no matter how I edit the DB or the usps.php file I still get multiple shipping options appearing, including cheaper inappropriate ones). Have you found a solution to this? Hope so! Jade Quote Link to comment Share on other sites More sharing options...
jadeb Posted May 30, 2007 Share Posted May 30, 2007 I've got an update on this now. I solved the problem myself. So, if you've been experiencing the problem of not being able to select which shipping options to offer, the following worked for me. Explanation: in my case, it seems I wasn't using the most recent version of the USPS module when I tried to update for the new USPS names and rates. As a result, some of my installation files were out of date and didn't have the necessary functionality to display the shipping methods options within the admin shipping module editing interface. So, I went to http://www.oscommerce.com/community/contributions,487/ and downloaded USPS Methods 2.8d. Before installing, I uninstalled my previous USPS module and even went so far as to login to my SQL admin and browse the "configuration" table to make sure there were no remaining entries for the previous module (I found one that wasn't deleted) and deleted whatever was left. IMPORTANT: Before installing the USPS module, I also jumped ahead to the May 14 rates change fix instructions and performed the SQL update to permit more than 255 characters in the database. This was necessary (at least on my system) because the new DB entry for International shipping rates requires 280 characters. So, the SQL update I used is: ALTER TABLE `configuration` CHANGE `set_function` `set_function` VARCHAR( 555 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; Once this was successful, I then made the required changes to usps.php as decribed in the steps for the May 14 USPS rates change. With the modified usps.php, I then followed the original instructions for USPS Methods 2.8d and uploaded all the necessary files and then clicked install in my admin panel and voila. It worked perfectly and I now have the ability to pick and choose which methods from within my osCommerce admin panel. I hope this is helpful to anyone who was facing the same problem. Cheers, Jade Quote Link to comment Share on other sites More sharing options...
thischarmingham Posted May 31, 2007 Share Posted May 31, 2007 I've got an update on this now. I solved the problem myself. So, if you've been experiencing the problem of not being able to select which shipping options to offer, the following worked for me. Explanation: in my case, it seems I wasn't using the most recent version of the USPS module when I tried to update for the new USPS names and rates. As a result, some of my installation files were out of date and didn't have the necessary functionality to display the shipping methods options within the admin shipping module editing interface. So, I went to http://www.oscommerce.com/community/contributions,487/ and downloaded USPS Methods 2.8d. Before installing, I uninstalled my previous USPS module and even went so far as to login to my SQL admin and browse the "configuration" table to make sure there were no remaining entries for the previous module (I found one that wasn't deleted) and deleted whatever was left. IMPORTANT: Before installing the USPS module, I also jumped ahead to the May 14 rates change fix instructions and performed the SQL update to permit more than 255 characters in the database. This was necessary (at least on my system) because the new DB entry for International shipping rates requires 280 characters. So, the SQL update I used is: ALTER TABLE `configuration` CHANGE `set_function` `set_function` VARCHAR( 555 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; Once this was successful, I then made the required changes to usps.php as decribed in the steps for the May 14 USPS rates change. With the modified usps.php, I then followed the original instructions for USPS Methods 2.8d and uploaded all the necessary files and then clicked install in my admin panel and voila. It worked perfectly and I now have the ability to pick and choose which methods from within my osCommerce admin panel. I hope this is helpful to anyone who was facing the same problem. Cheers, Jade Is there any way to do this with out installing a bunch of stuff? Everytime I try that sort of thing it completly shuts down the store. It never seems to come out right. All I want to do is some simple text editing here. Quote Link to comment Share on other sites More sharing options...
thischarmingham Posted May 31, 2007 Share Posted May 31, 2007 Also when I download that update it's telling me to edit portions of the code. Is there a place I can just get the entire code as it should be instead of doing the editing and leaving myself open for errors I don't understand/can't fix? Quote Link to comment Share on other sites More sharing options...
jadeb Posted May 31, 2007 Share Posted May 31, 2007 (edited) Is there any way to do this with out installing a bunch of stuff? Everytime I try that sort of thing it completly shuts down the store. It never seems to come out right. All I want to do is some simple text editing here. Sorry, but I don't think so. If you'll notice in my explanation above, the problem (at least for me) was that I was using an older version of the USPS module to begin with. So that's why the text editing alone won't solve the problem. It was necessary (again, at least for me) to upgrade to the most recent version of the module and then make the edits for the recent USPS update. On top of that, even with the most recent version, some of the text edits require that the SQL database be modified to allow more than 255 characters in an entry. Without that modification the editing alone wouldn't work either. Good luck. Edited May 31, 2007 by jadeb Quote Link to comment Share on other sites More sharing options...
ksolito Posted June 1, 2007 Share Posted June 1, 2007 I'm having a problem with the following SQL update: ALTER TABLE `configuration` CHANGE `set_function` `set_function` VARCHAR( 555 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL; phpMyAdmin is returning this error when I execute the sql query above: Error SQL query: ALTER TABLE `configuration` CHANGE `set_function` `set_function` VARCHAR( 555 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL MySQL said: #1074 - Too big column length for column 'set_function' (max = 255). Use BLOB instead Any suggestions what the problem is? Quote Link to comment Share on other sites More sharing options...
Marty4Code Posted August 16, 2007 Share Posted August 16, 2007 Thank you thischarmingham for the SQL update. Solved my problems.... For those who are searching, the problem I had was that not all possible USPS International Shipping options were being returned in the Shipping quote. I had all the options checked in Admin (with the newest USPS mod), but only got results for Global Express and Express, but did not get rates for Priority or First Class which would be cheaper for customers. The problem was related to the "set_function" field in the Configuration table being too small to hold all the necessary USPS International shipping options. So the last couple were getting cut off. Thanks to those above who posted the query to fix this. Quote Link to comment Share on other sites More sharing options...
lhwagner Posted September 20, 2007 Share Posted September 20, 2007 I followed that entire procedure and added the USPS Methods shipping module back in. I click the "Edit" button and get the panel with the configuration fields, but no matter what I enter, userid and password always go back to "NONE" and the options and methods I select always go back to the defaults (all). What am I missing here? 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.