Full service web hosting, great prices and support. Starts at $1.99/month!
Results 1 to 10 of 10

Thread: Going Postal

  1. #1

    Default Going Postal

    <ignore>Should you not understand what I am asking,not really care or are too intelligent to respond to such a lame request please follow the code.

    I have been trying for days now to write the sql needed and code to change the insurance entrys in the USPS module to meet the new insurance rates. I have failed miserably and gave up about 3 beers ago.

    In domestic it currently has
    up to $50
    Per $100

    It now needs to calculate the correct rates since they are not in the same increments as before.
    up to $50 ($1.65)
    $50-100 ($2.05) this is plus .40
    100.01-200 ($2.45) this is plus .40
    200.10-300 ($4.60) oops this is plus $2.15 this is why people go postal!
    Per $100 after that (.90 per $100)

    In International(this is harder) you now have International Priority as well as Express Mail both with different insurance rates. So you need boxes if someones selects international priority and boxes if the customer chooses Express Mail

    Express Mail $100-$200 .75
    Per $100 after that $1.35

    International Priority
    Up to $50 ($2.40)
    Up to $100 ($3.30)
    Per $100 after ($.90)

    So after screwing up trying to put the boxes in to add those changes and have them line up with the customers selection of service I am groveling for some help.</ignore>

    PS All credit for the code <tags> that was used in the above post goes to JPF

  2. #2

    Default Re: Going Postal

    You used the tags incorrectly - I ignored the whole thing.... Hehehe


    If (don't_understand_what_I_am_getting_at = TRUE) {
    put it in here


    Did you edit the USPS.PHP file?

    PHP Code:
        function install() {
    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 ('Enable USPS Shipping', 'MODULE_SHIPPING_USPS_STATUS', 'True', 'Do you want to offer USPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS User ID', 'MODULE_SHIPPING_USPS_USERID', 'NONE', 'Enter the USPS USERID assigned to you.', '6', '0', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS Password', 'MODULE_SHIPPING_USPS_PASSWORD', 'NONE', 'See USERID, above.', '6', '0', now())");
    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 ('Which server to use', 'MODULE_SHIPPING_USPS_SERVER', 'production', 'An account at USPS is needed to use the Production server', '6', '0', 'tep_cfg_select_option(array(\'test\', \'production\'), ', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_USPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_USPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_USPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_USPS_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    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 ('Domestic Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES', 'Express, Priority, First Class, Parcel, BPM, Library, Media,', 'Select the domestic services to be offered:', '6', '14', 'tep_cfg_select_multioption(array(\'Express\', \'Priority\', \'First Class\', \'Parcel\',\'BPM\',\'Library\',\'Media\'), ',  now())");
    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', 'GXG Document, GXG Non-Document, Express, Priority Lg, Priority Sm, Priority Var, Airmail Letter, Airmail Parcel, Surface Letter, Surface Post', 'Select the international services to be offered:', '6', '15', 'tep_cfg_select_multioption(array(\'GXG Document\', \'GXG Non-Document\', \'Express\', \'Priority Lg\', \'Priority Sm\', \'Priority Var\', \'Airmail Letter\', \'Airmail Parcel\', \'Surface Letter\', \'Surface Post\'), ',  now())");
    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 ('USPS Options', 'MODULE_SHIPPING_USPS_OPTIONS', 'Display weight, Display transit time', 'Select from the following the USPS options.', '6', '16', 'tep_cfg_select_multioption(array(\'Display weight\', \'Display transit time\'), ',  now())");
    //configuration values for insurance
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('US/Canada to $50', 'MODULE_SHIPPING_USPS_INS1', '1.30', 'US/Canada insurance total up to $50', '6', '0', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('US/Canada $50-100', 'MODULE_SHIPPING_USPS_INS2', '2.20', 'US/Canada insurance for totals $50.01-$100', '6', '0', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('US/Canada per $100', 'MODULE_SHIPPING_USPS_INS3', '1.00', 'US/Canada for every $100 over $100 add $', '6', '0', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('International to $50', 'MODULE_SHIPPING_USPS_INS4', '1.85', 'International insurance total up to $50', '6', '0', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('International $50-100', 'MODULE_SHIPPING_USPS_INS5', '2.60', 'International insurance for totals $50.01-$100', '6', '0', now())");
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('International per $100', 'MODULE_SHIPPING_USPS_INS6', '1.00', 'International for every $100 over $100 add $', '6', '0', now())");
    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 ('Insure Packages', 'MODULE_SHIPPING_USPS_INSURE', 'True', 'Insure packages shipped by USPS?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
    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 ('Insure Tax', 'MODULE_SHIPPING_USPS_INSURE_TAX', 'True', 'Insure tax on packages shipped by USPS?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
    Last edited by jpf; 05-29-2007 at 08:15 AM. Reason: Sorry distracted and forgot php tags.

  3. #3

    Default Re: Going Postal

    Thank you for your reply. Sorry for the incorrect code. I told you it was 3 beers ago

    I have messed a bunch with the USPS.php file

    when I get some time today I will look at the code you put in but I believe on a quick glance I had something similar, my main problem possibly is in mysql,getting the boxes to show in admin properly and in the right order plus the biggie is now there are 2 different insurances for International Exrpess Mail and International Priority Mail and trying to figure out how in admin to differentiate between the 2. Some sort of } elseif

    Did that make sense? I am super busy today and typed this quick.

  4. #4

    Default Re: Going Postal

    Jpf yes that is the code I changed but I realized I had a fatal error

    Fatal error: Call to a BRAIN function on Miller-Light in \catalog\includes\modules\bkpiesbrain.php on all lines

    I missed changing the code below that here:


    The domestic works perfectly now and I will attach my usps.php module here if someone wants the insurance on domestic to work they can use my changes. There are 3 sections that need to be changed. Use a compare tool.

    My problem now is there is only one calculation for Insurance for International mail which means I can put in the correct amounts for either International priority or Express Mail International but not both since each now have different insurance rates. How do I change it to handle both. That is where I am really stumped.

    Thanks in advance
    Attached Files Attached Files

  5. #5

    Default Re: Going Postal

    You might want to look at:

    osCommerce: USPS Methods

  6. #6

    Default Re: Going Postal

    Already did and am using that but it does not cover the insurance part of the module. That is why I had to rewrite the usps.php code for the domestic insurance.
    The post office used to only have one set of rates for International but now it depends on the service you choose. I just can't get it to seperate the insurance rate for International Express mail which is .75 then 1.35 per $100
    from International Priority which has a completely different set of insurance rates. Right now I just have a disclaimer on the site for International and use the more expensive insurance rates.

  7. #7

    Default Re: Going Postal

    I insstalled this module, but it will not let me edit is. I get the error message:
    Fatal error: Call to undefined function: tep_cfg_select_multioption() in /Users/spcalia/Sites/dusty/shopping/catalog/admin/modules.php(213) : eval()'d code on line 1

  8. #8

    Default Re: Going Postal

    Which version are you using. The latest at oscommerce at jpf's link above? Did you un-install and re-install in the admin section? Have you replaced your usps.php file in modules?

  9. #9

    Default Re: Going Postal

    bkpie asks:
    Which version are you using. The latest at oscommerce at jpf's link above? Did you un-install and re-install in the admin section? Have you replaced your usps.php file in modules?


    I am using oscommerce-2.2rc2a
    I did not un-install and re-restall the admin.
    I did replace usps.php in the includes/modules

  10. #10

    Default Re: Going Postal

    Since you did replace the usps.php then you have to go to admin then to modules shipping remove usps then click install again. If that doesent work you may have a corrupted usps.php some later versions were released since mine here osCommerce: USPS Methods

Similar Threads

  1. United States Postal Service
    By Btwixt_Group in forum osCommerce 2.2 Installation Help
    Replies: 3
    Last Post: 12-21-2004, 03:42 PM
  2. Postal Countries Are Dated and Funny
    By AceDog in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 04-02-2004, 06:06 AM
  3. Postal code label and input box shifted left after move
    By cvc505 in forum osCommerce 2.2 Installation Help
    Replies: 0
    Last Post: 06-09-2003, 07:56 PM



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts