osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Going Postal

This is a discussion on Going Postal within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; <ignore>Should you not understand what I am asking,not really care or are too intelligent to respond ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 05-29-2007, 05:54 AM
Active Member
 
Join Date: Sep 2004
Posts: 286
Thanks: 23
Thanked 34 Times in 33 Posts
Rep Power: 5
bkpie has a spectacular aura aboutbkpie has a spectacular aura about
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
$50-100
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 05-29-2007, 08:14 AM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Posts: 1,522
Thanks: 1
Thanked 81 Times in 68 Posts
Rep Power: 10
jpf is just really nicejpf is just really nicejpf is just really nicejpf is just really nicejpf is just really nice
Default Re: Going Postal

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

use:

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

Hehehe

Did you edit the USPS.PHP file?

mainly:
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 05-29-2007, 08:45 AM
Active Member
 
Join Date: Sep 2004
Posts: 286
Thanks: 23
Thanked 34 Times in 33 Posts
Rep Power: 5
bkpie has a spectacular aura aboutbkpie has a spectacular aura about
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 06-01-2007, 02:30 PM
Active Member
 
Join Date: Sep 2004
Posts: 286
Thanks: 23
Thanked 34 Times in 33 Posts
Rep Power: 5
bkpie has a spectacular aura aboutbkpie has a spectacular aura about
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:

return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_PASSWORD', 'MODULE_SHIPPING_USPS_SERVER', 'MODULE_SHIPPING_USPS_HANDLING', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER', 'MODULE_SHIPPING_USPS_OPTIONS', 'MODULE_SHIPPING_USPS_TYPES', 'MODULE_SHIPPING_USPS_TYPES_INTL', 'MODULE_SHIPPING_USPS_INS1', 'MODULE_SHIPPING_USPS_INS2', 'MODULE_SHIPPING_USPS_INS3','MODULE_SHIPPING_USPS_ INS4', 'MODULE_SHIPPING_USPS_INS5', 'MODULE_SHIPPING_USPS_INS6','MODULE_SHIPPING_USPS_ INS7','MODULE_SHIPPING_USPS_INS8','MODULE_SHIPPING _USPS_INSURE','MODULE_SHIPPING_USPS_INSURE

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
File Type: zip usps.zip (8.9 KB, 29 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 06-02-2007, 06:11 PM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Posts: 1,522
Thanks: 1
Thanked 81 Times in 68 Posts
Rep Power: 10
jpf is just really nicejpf is just really nicejpf is just really nicejpf is just really nicejpf is just really nice
Default Re: Going Postal

You might want to look at:

osCommerce: USPS Methods
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 06-02-2007, 06:41 PM
Active Member
 
Join Date: Sep 2004
Posts: 286
Thanks: 23
Thanked 34 Times in 33 Posts
Rep Power: 5
bkpie has a spectacular aura aboutbkpie has a spectacular aura about
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 03-27-2008, 10:40 AM
Lurker
 
Join Date: Mar 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
spcalia is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 03-27-2008, 02:14 PM
Active Member
 
Join Date: Sep 2004
Posts: 286
Thanks: 23
Thanked 34 Times in 33 Posts
Rep Power: 5
bkpie has a spectacular aura aboutbkpie has a spectacular aura about
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 03-27-2008, 03:57 PM
Lurker
 
Join Date: Mar 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
spcalia is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 03-27-2008, 06:18 PM
Active Member
 
Join Date: Sep 2004
Posts: 286
Thanks: 23
Thanked 34 Times in 33 Posts
Rep Power: 5
bkpie has a spectacular aura aboutbkpie has a spectacular aura about
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 02:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2008 osCMax