OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: USPS Shipping Insurance
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Order Total Modules
Pages: 1, 2
olsonsp4c
This is the support forum topic for USPS Shipping Insurance which displays USPS shipping insurance rates on checkout_payment.php and allows for selection/deselecton of this option. It then adds the proper shipping
insurance amount to the order total on checkout_confirmation.php. Please read all the installation notes before installing.

This addon can be found here:



Hope this serves the community.

Scott (olsonsp4c)
olsonsp4c
It took me too long to finish the package because I wanted to include screenshots. Here is where you can find it:

USPS Shipping Insurance 1.0

If that does not work: http://addons.oscommerce.com/info/5782

Enjoy and please work together to improve this addon; so, all changes and mods to this addon must be discussed here before they will be integrated into the addon. If you have suggestions, feel free to email or message me.

Scott (olsonsp4c)
crafterscafe
I tried a different insurance mod and it didn't show up in my modules options - before I try this one is it working?
olsonsp4c
QUOTE (crafterscafe @ Mar 5 2008, 02:15 PM) *
I tried a different insurance mod and it didn't show up in my modules options - before I try this one is it working?


it works - i have it working on my store.

Scott
crafterscafe
I have followed the instructions, checked everything twice, the files are in the correct directory - but there is no option in the admin / modules. the only thing that was different was my stylesheet was in the catalog directory. Please help!

Never mind - after I walked away for a minute I realized what I did!!!
crafterscafe
okay - I got into the insurance module- however, when I select priorty it is forcing express at checkout?
kimm
Nice addition! Thank you.

I am having a problem getting the module to include sales tax in the calculation. Can you direct me to what I am doing wrong?

Thanks in advance
Kim
olsonsp4c
QUOTE (crafterscafe @ Mar 5 2008, 05:29 PM) *
okay - I got into the insurance module- however, when I select priorty it is forcing express at checkout?


This is not a problem with the insurance module, but with the shipping module. I've seen this on the USPS forums several times, please check there.

Scott
crafterscafe
I figured it out. you need to change the order to put the insurance above the tax.
olsonsp4c
QUOTE (kimm @ Mar 12 2008, 09:02 AM) *
Nice addition! Thank you.

I am having a problem getting the module to include sales tax in the calculation. Can you direct me to what I am doing wrong?

Thanks in advance
Kim


Hi Kim,

This is a shot in the dark with little info, but here it is...

1. Make sure that you have set the include tax option to True and click the update/save button (i know that is obvious)
2. Make sure that the sort order of the insurance module is AFTER the "Tax" in the order totals modules in the admin (per the instructions - see below)

Sort Order? Set this to the order you want it to appear in the totals table.
See how your Order Total Modules have a Sort Order? Well, I use Shipping
as 3 and Shipping Insurance as 4. Be careful NOT to have two modules with
the same order number. Note that ANY modules ordered after it, excluding
shipping, will not be included in the total insured.

Hope this is the solution for you.

Scott
olsonsp4c
QUOTE (crafterscafe @ Mar 12 2008, 10:34 AM) *
I figured it out. you need to change the order to put the insurance above the tax.


Thanks for letting me know - sort orders are important with order total modules. appreciate your use of my addon Sue.

Scott
kimm
QUOTE (olsonsp4c @ Mar 12 2008, 11:36 AM) *
Hi Kim,

This is a shot in the dark with little info, but here it is...

1. Make sure that you have set the include tax option to True and click the update/save button (i know that is obvious)
2. Make sure that the sort order of the insurance module is AFTER the "Tax" in the order totals modules in the admin (per the instructions - see below)

Sort Order? Set this to the order you want it to appear in the totals table.
See how your Order Total Modules have a Sort Order? Well, I use Shipping
as 3 and Shipping Insurance as 4. Be careful NOT to have two modules with
the same order number. Note that ANY modules ordered after it, excluding
shipping, will not be included in the total insured.

Hope this is the solution for you.

Scott


Here's my settings. Just can't get the shipping insurance to add sales tax and I don't know much about php coding. I'm open to suggestions.

Discount Coupons 5
Gift Vouchers 6
Low Order Fee
Shipping 2
Sub-Total 1
Tax 4
Total 7
USPS Shipping Insurance 3

Please check the USPS Website to confirm the accuracy of the insurance rates by clicking HERE for domestic rates and clicking HERE for international rates.

Insure Packages
True

Insure Tax
True

Customer Choice
True

Sort Order
3

US/Canada $.01-$50.00
$1.65

US/Canada $50.01-$100.00
$2.05

US/Canada $100.01-$200.00
$2.45

US/Canada $200.01-$300.00
$4.60

US/Canada per $100 over $300
$0.90

International $.01-$50.00
$0.00

International $50.01-$100.00
$0.00

International $100.01-$200.00
$0.00

International $200.01-$300.00
$0.00

International per $100 over $300
$0.00
olsonsp4c
QUOTE (kimm @ Mar 12 2008, 10:18 PM) *
Here's my settings. Just can't get the shipping insurance to add sales tax and I don't know much about php coding. I'm open to suggestions.

Discount Coupons 5
Gift Vouchers 6
Low Order Fee
Shipping 2
Sub-Total 1
Tax 4
Total 7
USPS Shipping Insurance 3


USPS Shipping Insurance must be 1 higher in the order than Tax, so re-order them with this in mind. So:

subtotal 1
shipping 2
tax 3
usps shipping insurance 4
and so on...

Scott
kimm
QUOTE (olsonsp4c @ Mar 13 2008, 12:41 AM) *
USPS Shipping Insurance must be 1 higher in the order than Tax, so re-order them with this in mind. So:

subtotal 1
shipping 2
tax 3
usps shipping insurance 4
and so on...

Scott


Hey Scott,

Tried setting shipping insurance as 4 as you suggested even tried it as 2 and 7. No matter where I place it the sales tax is not getting calculated on the shipping insurance portion of the order total.
Dennisra
I added the code to the stylesheet but I can't seem to control the size of the text at checkout_payment. Anyone else have this problem. Any tips to fix this. Other than that seems to work great and this is a contribution that was really needed. Thank you!

Dennisra
I used the following in the stylesheet and it works fine now. Thanks to the author for a really nice addition.

/* USPS Insurance */
TD.tinyText, SPAN.tinyText, P.tinyText {
font-family: Verdana, Arial, sans-serif;
font-size: 8px;
}
/* USPS Insurance */
olsonsp4c
QUOTE (Dennisra @ Mar 13 2008, 02:08 PM) *
I used the following in the stylesheet and it works fine now. Thanks to the author for a really nice addition.

/* USPS Insurance */
TD.tinyText, SPAN.tinyText, P.tinyText {
font-family: Verdana, Arial, sans-serif;
font-size: 8px;
}
/* USPS Insurance */


Thanks for the update! Are you saying that you just missed that part of the instructions?

Scott
Dennisra
No, I didn't miss it. The instructions were there and correct. However, when I added that to the stylesheet I wanted to isolate it from other additions and be able to come back later and see what it was for and I erroneously added this:

// USPS Insurance
TD.tinyText, SPAN.tinyText, P.tinyText {
font-family: Verdana, Arial, sans-serif;
font-size: 8px;
}
// USPS Insurance

That didn't work for me but this did:

/* USPS Insurance */
TD.tinyText, SPAN.tinyText, P.tinyText {
font-family: Verdana, Arial, sans-serif;
font-size: 8px;
}
/* USPS Insurance */

Thanks again for the contribution. I have received a dozen orders since adding (none with PayPal yet) and it works great so far.
olsonsp4c
QUOTE (Dennisra @ Mar 14 2008, 04:12 PM) *
No, I didn't miss it. The instructions were there and correct. However, when I added that to the stylesheet I wanted to isolate it from other additions and be able to come back later and see what it was for and I erroneously added this:

// USPS Insurance
TD.tinyText, SPAN.tinyText, P.tinyText {
font-family: Verdana, Arial, sans-serif;
font-size: 8px;
}
// USPS Insurance

That didn't work for me but this did:

/* USPS Insurance */
TD.tinyText, SPAN.tinyText, P.tinyText {
font-family: Verdana, Arial, sans-serif;
font-size: 8px;
}
/* USPS Insurance */

Thanks again for the contribution. I have received a dozen orders since adding (none with PayPal yet) and it works great so far.


Your welcome - the addon does not work like it should, but it is good enough for now!

Scott
Dennisra
Scott:

Now you have me puzzled. What do you mean when you say "does not work like it should"? What doesn't wok?

Dennis

QUOTE (olsonsp4c @ Mar 14 2008, 07:31 PM) *
Your welcome - the addon does not work like it should, but it is good enough for now!

Scott
olsonsp4c
QUOTE (Dennisra @ Mar 14 2008, 06:24 PM) *
Scott:

Now you have me puzzled. What do you mean when you say "does not work like it should"? What doesn't wok?

Dennis


It works for only 1 package per order, more than 1 package per order and it won't calculate properly because I don't know how to get the order_totals module to import the $shipping_num_boxes variable from includes/classes/shipping.php - also, I'd rather have it on the checkout_shipping.php page, but I can't figure out how to carry the variable through checkout_payment.php to checkout_confirmation.php

Also, several people have reported tax issues, but I have not verified this personally.

thanks!

Scott
Dennisra
I understand.

It works well for me as I only ship one package at a time and the tax calculation is working properly for me. I saw references to that but I am not required to collect tax for the shipping cost so it's just fine as is. In addition, it's very accurate. If you have the tare weight correct and the weight of the merchandise correct the shipping charges with insurance are 100% on the nose.

Thanks again!
Dennisra
A major problem after receiving the first few orders paid by PayPal. The insurance charge is NOT added to the PayPal payment. So the order invoice shows they wanted insurance but they don't pay for it when using PayPal. What to do now?
kimm
Hey Scott,

I think I may have found the reason that tax is not cal
culated on the shipping insurance. I have CCGV(trad) loaded and I found the following code in checkout_confirmation:
$payment_modules->update_status();

$order_total_modules = new order_total;// CCGV
$order_total_modules->collect_posts();// CCGV
$order_total_modules->pre_confirmation_check();// CCGV

// Line edited for CCGV
// if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
}

if (is_array($payment_modules->modules)) {
$payment_modules->pre_confirmation_check();
}

// load the selected shipping module
require(DIR_WS_CLASSES . 'shipping.php');
$shipping_modules = new shipping($shipping);
$_SESSION['choose_insurance'] = $_POST[choose_insurance]; //USPS shipping insurance
//Lines below repositioned for CCGV
// require(DIR_WS_CLASSES . 'order_total.php');
// $order_total_modules = new order_total;


It appears that the repositioned lines keep the shipping insurance from getting added into the order total. Any suggestions on how to fix this? I am a php dummy.

TIA
Kim
Dennisra
(Adding information for my PayPal problem posting above.)

The variable for insurance needs to be added to the /ext/ipn.php as it is for shipping below in ipn.php. Or, shipping and insurance could be added together on the order_confirmation page and then the variable "shipping" would be fine.
Would someone write the code for either of those?
[Sat Mar 15 17:13:10 2008] [error] PP TEST received POST variable: shipping : 1.98
olsonsp4c
QUOTE (kimm @ Mar 15 2008, 08:53 PM) *
Hey Scott,

I think I may have found the reason that tax is not cal
culated on the shipping insurance. I have CCGV(trad) loaded and I found the following code in checkout_confirmation:
$payment_modules->update_status();

$order_total_modules = new order_total;// CCGV
$order_total_modules->collect_posts();// CCGV
$order_total_modules->pre_confirmation_check();// CCGV

// Line edited for CCGV
// if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
}

if (is_array($payment_modules->modules)) {
$payment_modules->pre_confirmation_check();
}

// load the selected shipping module
require(DIR_WS_CLASSES . 'shipping.php');
$shipping_modules = new shipping($shipping);
$_SESSION['choose_insurance'] = $_POST[choose_insurance]; //USPS shipping insurance
//Lines below repositioned for CCGV
// require(DIR_WS_CLASSES . 'order_total.php');
// $order_total_modules = new order_total;


It appears that the repositioned lines keep the shipping insurance from getting added into the order total. Any suggestions on how to fix this? I am a php dummy.

TIA
Kim


Kim,

try reposition the shipping lines to right before: $order_total_modules = new order_total;// CCGV

let me know what happens...

Scott
olsonsp4c
QUOTE (Dennisra @ Mar 15 2008, 09:43 PM) *
(Adding information for my PayPal problem posting above.)

The variable for insurance needs to be added to the /ext/ipn.php as it is for shipping below in ipn.php. Or, shipping and insurance could be added together on the order_confirmation page and then the variable "shipping" would be fine.
Would someone write the code for either of those?
[Sat Mar 15 17:13:10 2008] [error] PP TEST received POST variable: shipping : 1.98


some paypal modules need the following fix... if you install this contribution and the shipping insurance is not included in your paypal totals, TRY making the changes outlined below.

You will need to MOVE the lines that you are instructed to insert into checkout_process.php so that the following three lines (not counting blanks):

require(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;

$order_totals = $order_total_modules->process();

are just ABOVE the added part instead of below it and these 2 lines:

// load the before_process function from the payment modules
$payment_modules->before_process();

are JUST BELOW it

SO IT LOOKS LIKE THIS:
========================================
require(DIR_WS_CLASSES . 'order.php');
$order = new order;
require(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;

$order_totals = $order_total_modules->process();

Try this and let me know if it helps...

Scott
Dennisra
Hi Scott:

Wow! Thanks for getting back so quickly.

I am certain that is the way my PayPal module is already set up. I have posted the code below:
CODE
   // load selected payment module
     require(DIR_WS_CLASSES . 'payment.php');
     $payment_modules = new payment($payment);
  
   // load the selected shipping module
     require(DIR_WS_CLASSES . 'shipping.php');
     $shipping_modules = new shipping($shipping);
  
     require(DIR_WS_CLASSES . 'order.php');
     $order = new order;
  
   //Shifted this way down to transport shopping points to paypal
   // load the before_process function from the payment modules
   //  $payment_modules->before_process();
  
     require(DIR_WS_CLASSES . 'order_total.php');
     $order_total_modules = new order_total;
  
     $order_totals = $order_total_modules->process();
  
   // load the before_process function from the payment modules
     $payment_modules->before_process();
  
     $sql_data_array = array('customers_id' => $customer_id,
                             'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
                             'customers_company' => $order->customer['company'],
                             'customers_street_address' => $order->customer['street_address'],
                             'customers_suburb' => $order->customer
kimm
QUOTE (olsonsp4c @ Mar 16 2008, 12:31 AM) *
Kim,

try reposition the shipping lines to right before: $order_total_modules = new order_total;// CCGV

let me know what happens...

Scott


I guess that wasn't the problem. Made the change and still not sales tax calculated on shipping insurance. There is no place on the admin side when setting up the insurance to identify what tax class to use. Should there be? Maybe I did something wrong during the install.
olsonsp4c
QUOTE (kimm @ Mar 16 2008, 11:46 AM) *
I guess that wasn't the problem. Made the change and still not sales tax calculated on shipping insurance. There is no place on the admin side when setting up the insurance to identify what tax class to use. Should there be? Maybe I did something wrong during the install.


OK, change the code back to the way it was - let me check into your question and get back with you smile.gif

Scott
olsonsp4c
QUOTE (kimm @ Mar 16 2008, 11:46 AM) *
I guess that wasn't the problem. Made the change and still not sales tax calculated on shipping insurance. There is no place on the admin side when setting up the insurance to identify what tax class to use. Should there be? Maybe I did something wrong during the install.


That is the issue Kimm... this is the adjustment - i will update it in the next release - sorry about that:

1. Remove the order total module
2. Open includes/modules/order_total/ot_uspsinsurance.php

FIND this:

CODE
      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_OT_USPSINSURANCE_INSURE_TAX', 'True', 'Insure tax on packages shipped by USPS?', '6', '2', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");


AFTER add this:

CODE
      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_USPSFLAT_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())");


3. Re-install
4. Make the sort order appropriate and choose options

it should work smile.gif

Scott
kimm
QUOTE (olsonsp4c @ Mar 16 2008, 10:49 PM) *
That is the issue Kimm... this is the adjustment - i will update it in the next release - sorry about that:

1. Remove the order total module
2. Open includes/modules/order_total/ot_uspsinsurance.php

FIND this:

CODE
      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_OT_USPSINSURANCE_INSURE_TAX', 'True', 'Insure tax on packages shipped by USPS?', '6', '2', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");


AFTER add this:

CODE
      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_USPSFLAT_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())");


3. Re-install
4. Make the sort order appropriate and choose options

it should work smile.gif

Scott

Ok I made the change in the file and can see the changed in the database but I don't get a drop down box in admin for the tax class.
olsonsp4c
QUOTE (kimm @ Mar 16 2008, 10:29 PM) *
Ok I made the change in the file and can see the changed in the database but I don't get a drop down box in admin for the tax class.


oops, i forgot another...

1. Remove the module
2. make these changes


FIND this:

CODE
      return array('MODULE_OT_USPSINSURANCE_STATUS', 'MODULE_OT_USPSINSURANCE_INSURE_TAX', 'MODULE_OT_USPSINSURANCE_CHOICE', 'MODULE_OT_USPSINSURANCE_SORT_ORDER', 'MODULE_OT_USPS_INS1', 'MODULE_OT_USPS_INS2', 'MODULE_OT_USPS_INS3','MODULE_OT_USPS_INS4', 'MODULE_OT_USPS_INS5', 'MODULE_OT_USPS_INS6', 'MODULE_OT_USPS_INS7', 'MODULE_OT_USPS_INS8', 'MODULE_OT_USPS_INS9', 'MODULE_OT_USPS_INS10');


REPLACE with this:

CODE
      return array('MODULE_OT_USPSINSURANCE_STATUS', 'MODULE_OT_USPSINSURANCE_INSURE_TAX', 'MODULE_OT_USPSFLAT_TAX_CLASS', 'MODULE_OT_USPSINSURANCE_CHOICE', 'MODULE_OT_USPSINSURANCE_SORT_ORDER', 'MODULE_OT_USPS_INS1', 'MODULE_OT_USPS_INS2', 'MODULE_OT_USPS_INS3','MODULE_OT_USPS_INS4', 'MODULE_OT_USPS_INS5', 'MODULE_OT_USPS_INS6', 'MODULE_OT_USPS_INS7', 'MODULE_OT_USPS_INS8', 'MODULE_OT_USPS_INS9', 'MODULE_OT_USPS_INS10');


FIND this:

CODE
      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_USPSFLAT_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())");


REPLACE with this:
CODE
      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_OT_USPSINSURANCE_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())");


3. Re-install and choose options...

Hopefully it works! I made these changes on my test store and got the dropdown box... let me know!

smile.gif

Scott
kimm
QUOTE (olsonsp4c @ Mar 17 2008, 01:25 AM) *
oops, i forgot another...

1. Remove the module
2. make these changes
FIND this:

CODE
      return array('MODULE_OT_USPSINSURANCE_STATUS', 'MODULE_OT_USPSINSURANCE_INSURE_TAX', 'MODULE_OT_USPSINSURANCE_CHOICE', 'MODULE_OT_USPSINSURANCE_SORT_ORDER', 'MODULE_OT_USPS_INS1', 'MODULE_OT_USPS_INS2', 'MODULE_OT_USPS_INS3','MODULE_OT_USPS_INS4', 'MODULE_OT_USPS_INS5', 'MODULE_OT_USPS_INS6', 'MODULE_OT_USPS_INS7', 'MODULE_OT_USPS_INS8', 'MODULE_OT_USPS_INS9', 'MODULE_OT_USPS_INS10');


REPLACE with this:

CODE
      return array('MODULE_OT_USPSINSURANCE_STATUS', 'MODULE_OT_USPSINSURANCE_INSURE_TAX', 'MODULE_OT_USPSFLAT_TAX_CLASS', 'MODULE_OT_USPSINSURANCE_CHOICE', 'MODULE_OT_USPSINSURANCE_SORT_ORDER', 'MODULE_OT_USPS_INS1', 'MODULE_OT_USPS_INS2', 'MODULE_OT_USPS_INS3','MODULE_OT_USPS_INS4', 'MODULE_OT_USPS_INS5', 'MODULE_OT_USPS_INS6', 'MODULE_OT_USPS_INS7', 'MODULE_OT_USPS_INS8', 'MODULE_OT_USPS_INS9', 'MODULE_OT_USPS_INS10');


FIND this:

CODE
      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_USPSFLAT_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())");


REPLACE with this:
CODE
      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_OT_USPSINSURANCE_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())");


3. Re-install and choose options...

Hopefully it works! I made these changes on my test store and got the dropdown box... let me know!

smile.gif

Scott

Ok now I get a space in admin where I assume the new drop down should be but there is nothing in that area.
olsonsp4c
QUOTE (kimm @ Mar 17 2008, 12:29 AM) *
Ok now I get a space in admin where I assume the new drop down should be but there is nothing in that area.


Kimm,

I'm making mistakes... i apologize, it's late here in Portland.

the changes should have read this:

FIND this:


CODE
      return array('MODULE_OT_USPSINSURANCE_STATUS', 'MODULE_OT_USPSINSURANCE_INSURE_TAX', 'MODULE_OT_USPSINSURANCE_CHOICE', 'MODULE_OT_USPSINSURANCE_SORT_ORDER', 'MODULE_OT_USPS_INS1', 'MODULE_OT_USPS_INS2', 'MODULE_OT_USPS_INS3','MODULE_OT_USPS_INS4', 'MODULE_OT_USPS_INS5', 'MODULE_OT_USPS_INS6', 'MODULE_OT_USPS_INS7', 'MODULE_OT_USPS_INS8', 'MODULE_OT_USPS_INS9', 'MODULE_OT_USPS_INS10');


REPLACE with this:


CODE
      return array('MODULE_OT_USPSINSURANCE_STATUS', 'MODULE_OT_USPSINSURANCE_INSURE_TAX', 'MODULE_OT_USPSINSURANCE_TAX_CLASS', 'MODULE_OT_USPSINSURANCE_CHOICE', 'MODULE_OT_USPSINSURANCE_SORT_ORDER', 'MODULE_OT_USPS_INS1', 'MODULE_OT_USPS_INS2', 'MODULE_OT_USPS_INS3','MODULE_OT_USPS_INS4', 'MODULE_OT_USPS_INS5', 'MODULE_OT_USPS_INS6', 'MODULE_OT_USPS_INS7', 'MODULE_OT_USPS_INS8', 'MODULE_OT_USPS_INS9', 'MODULE_OT_USPS_INS10');


FIND this:


CODE
      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_USPSFLAT_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())");


REPLACE with this:

CODE
      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_OT_USPSINSURANCE_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())");



for you at this point it just means changing MODULE_OT_USPSFLAT_TAX_CLASS to MODULE_OT_USPSINSURANCE_TAX_CLASS in the 1st REPLACE

Scott
olsonsp4c
Joseph,

You are correct. Could you let me know which Paypal Module and version you are using?

One quick suggestion is to try making the same edit you made in checkout_confirmation.php to your Paypal file.

Scott
kimm
QUOTE (olsonsp4c @ Mar 17 2008, 02:36 AM) *
Kimm,

I'm making mistakes... i apologize, it's late here in Portland.

the changes should have read this:

FIND this:
CODE
      return array('MODULE_OT_USPSINSURANCE_STATUS', 'MODULE_OT_USPSINSURANCE_INSURE_TAX', 'MODULE_OT_USPSINSURANCE_CHOICE', 'MODULE_OT_USPSINSURANCE_SORT_ORDER', 'MODULE_OT_USPS_INS1', 'MODULE_OT_USPS_INS2', 'MODULE_OT_USPS_INS3','MODULE_OT_USPS_INS4', 'MODULE_OT_USPS_INS5', 'MODULE_OT_USPS_INS6', 'MODULE_OT_USPS_INS7', 'MODULE_OT_USPS_INS8', 'MODULE_OT_USPS_INS9', 'MODULE_OT_USPS_INS10');


REPLACE with this:
CODE
      return array('MODULE_OT_USPSINSURANCE_STATUS', 'MODULE_OT_USPSINSURANCE_INSURE_TAX', 'MODULE_OT_USPSINSURANCE_TAX_CLASS', 'MODULE_OT_USPSINSURANCE_CHOICE', 'MODULE_OT_USPSINSURANCE_SORT_ORDER', 'MODULE_OT_USPS_INS1', 'MODULE_OT_USPS_INS2', 'MODULE_OT_USPS_INS3','MODULE_OT_USPS_INS4', 'MODULE_OT_USPS_INS5', 'MODULE_OT_USPS_INS6', 'MODULE_OT_USPS_INS7', 'MODULE_OT_USPS_INS8', 'MODULE_OT_USPS_INS9', 'MODULE_OT_USPS_INS10');


FIND this:
CODE
      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_USPSFLAT_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())");


REPLACE with this:

CODE
      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_OT_USPSINSURANCE_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())");

for you at this point it just means changing MODULE_OT_USPSFLAT_TAX_CLASS to MODULE_OT_USPSINSURANCE_TAX_CLASS in the 1st REPLACE

Scott

I see you're a fellow night owl, its almost 3am here. I made the change and now get the drop down for tax class, however still no sales tax in the shipping calculation. I tried it with both versions of the checkout_confirmation mod.
olsonsp4c
QUOTE (kimm @ Mar 17 2008, 12:58 AM) *
I see you're a fellow night owl, its almost 3am here. I made the change and now get the drop down for tax class, however still no sales tax in the shipping calculation. I tried it with both versions of the checkout_confirmation mod.


Did you update the sort order so that shipping insurance is numbered 1 higher than tax?

could you clarify on the "both" versions of the checkout_confirmation.php file? I have not updated anything in this file (just the 1 edit - 1 added line)...

Scott
olsonsp4c
I just issued version 1.1 of this contribution:

Changes since v1.0
------------------
* Corrected the colspan to "3" instead of "4" in the second half of checkout_payment.php
* Corrected the table alignment issues in checkout_payment.php
* Added BEGIN and END comments to the stylesheet
* Added the missing Tax Class database entry and corresponding code edits
* Added update instructions

http://addons.oscommerce.com/info/5782

Scott
olsonsp4c
QUOTE (kimm @ Mar 17 2008, 12:58 AM) *
I see you're a fellow night owl, its almost 3am here. I made the change and now get the drop down for tax class, however still no sales tax in the shipping calculation. I tried it with both versions of the checkout_confirmation mod.


A few more edits and let me know what happens:

FIND this:

CODE
      $this->enabled = MODULE_OT_USPSINSURANCE_STATUS;


ADD this AFTER:

CODE
      $this->tax_class = MODULE_OT_USPSINSURANCE_TAX_CLASS;


FIND this:

CODE
        $this->output[] = array('title' => $this->title . ':',
                                'text' => $currencies->format($insurance, true, $order->info['currency'], $order->info['currency_value']),
                                'value' => ($insurance * $shipping_num_boxes));


ADD this AFTER:

CODE
        if ($this->tax_class > 0) {
          $this->output['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
        }


Let me know... i'm off to bed, hope this works...

Scott
Dennisra
Hi Scott:

I see you like a challenge. Me to.

I have updated to the newest version 1.1.

I am using osCommerce PayPal IPN v2.3.0.0.

I cannot find the correct place in the ipn.php to make the edit as I did in the checkout_confirmation.php. I would like you to look at the ipn.php file so you could make a suggestion about adding the edit. I have posted a copy of the file here.

I am going to test a PayPal payment again. If the problem was solved by updating to the newest version I let you know here shortly.

Thanks for all your help.

QUOTE (olsonsp4c @ Mar 17 2008, 02:47 AM) *
Joseph,

You are correct. Could you let me know which Paypal Module and version you are using?

One quick suggestion is to try making the same edit you made in checkout_confirmation.php to your Paypal file.

Scott
Dennisra
To make it clear what is happening.

This is what the transaction should be:
Sub-Total: $56.95
United States Postal Service (1 x 0.52lbs) (First Class Mail (Estimated: 2 - 5 Days)): $2.32
USPS Shipping Insurance: $2.05
State Sales Tax: $3.70
Total: $65.02


At PayPal
Subtotal: $60.65
Shipping and Handling: $2.32
Tax: (6.500% in Minnesota): $3.94
Total: $66.91 USD

It appears the sales tax is getting added to the cost of merchandise and the insurance charge does not get added to PayPal total.

olsonsp4c
QUOTE (Dennisra @ Mar 17 2008, 07:56 AM) *
To make it clear what is happening.

This is what the transaction should be:
Sub-Total: $56.95
United States Postal Service (1 x 0.52lbs) (First Class Mail (Estimated: 2 - 5 Days)): $2.32
USPS Shipping Insurance: $2.05
State Sales Tax: $3.70
Total: $65.02


At PayPal
Subtotal: $60.65
Shipping and Handling: $2.32
Tax: (6.500% in Minnesota): $3.94
Total: $66.91 USD

It appears the sales tax is getting added to the cost of merchandise and the insurance charge does not get added to PayPal total.



thanks for the update... i am out all day today, so I take a peek tomorrow.

if you need to, temporarily disable the mod so you don't lose money.

Scott
kimm
QUOTE (olsonsp4c @ Mar 17 2008, 03:37 AM) *
A few more edits and let me know what happens:

FIND this:

CODE
      $this->enabled = MODULE_OT_USPSINSURANCE_STATUS;


ADD this AFTER:

CODE
      $this->tax_class = MODULE_OT_USPSINSURANCE_TAX_CLASS;


FIND this:

CODE
        $this->output[] = array('title' => $this->title . ':',
                                'text' => $currencies->format($insurance, true, $order->info['currency'], $order->info['currency_value']),
                                'value' => ($insurance * $shipping_num_boxes));


ADD this AFTER:

CODE
        if ($this->tax_class > 0) {
          $this->output['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
        }


Let me know... i'm off to bed, hope this works...

Scott

Hey Scott,
Sorry but still no tax calculation. Have tried with the change to confirmation page and also with unchanged confirmation page. Have included all the changes to the order_total/ot_uspsinsurance.php file. Have different sort orders in admin side. No matter what I do it is not calculating sales tax on the insurance.
olsonsp4c
I have released version 1.1a which addresses the Tax Class issue and correctly adds the insurance amount to the order total.

http://addons.oscommerce.com/info/5782

Scott
olsonsp4c
QUOTE (Dennisra @ Mar 17 2008, 07:56 AM) *
To make it clear what is happening.

This is what the transaction should be:
Sub-Total: $56.95
United States Postal Service (1 x 0.52lbs) (First Class Mail (Estimated: 2 - 5 Days)): $2.32
USPS Shipping Insurance: $2.05
State Sales Tax: $3.70
Total: $65.02


At PayPal
Subtotal: $60.65
Shipping and Handling: $2.32
Tax: (6.500% in Minnesota): $3.94
Total: $66.91 USD

It appears the sales tax is getting added to the cost of merchandise and the insurance charge does not get added to PayPal total.



Thanks for the clarity - it seems that it might be getting passed to Paypal actually... well, it might be - adding the insurance to the sub-total and then passing it on to Paypal, but there is extra coming from somewhere that is unaccounted for... also, have you looked at this:

QUOTE(Aldebaran @ Dec 13 2007, 12:58 AM) *
Hi,
Running osCommerce 2.2-MS2 and installed the PayPal IPN module.

Get no errors, but if you enter a discount code, it is NOT getting passed to PayPal. PayPal uses the full amount and charges the full amount to customer, whether they have a credit card or are using a PayPal account.

I have the module set to aggregate, which others have said solved this issue, but this doesn't solve issue.

When you go back to store, the order shows the discounted amount and so does the email sent to customer - so there's a big mismatch.

All suggestions welcome rolleyes.gif

Everything else appears to work normally.

Jill


I have the same problems as you. discount and insurance do not pass to paypal. I tried the following way. I am not sure it will solve the problem until my customer buy one product. do you set up any thing in paypal-->profile-->shipping calculation???

1.) make sure you have your shipping mods. set up like you want in os.
2.)Log into your paypal account.
3.)Click on "profile"
4.)Click on "Set Up Shipping Calculations"
5.)Make sure there is NOTHING set up here.

thanks!

Scott
Dennisra
For now anyway I am just not accepting PayPal for payment of orders. That seems to make life a lot simpler.
olsonsp4c
QUOTE (Dennisra @ Mar 20 2008, 06:52 PM) *
For now anyway I am just not accepting PayPal for payment of orders. That seems to make life a lot simpler.


I use an older version of the Paypal IPN, version 1.4 by windfif and it works very will and does pass things along properly. You might try that version.

Scott
Dennisra
QUOTE (olsonsp4c @ Mar 21 2008, 01:11 PM) *
Paypal IPN, version 1.4 by windfif

I will give that a try Scott. Thanks!
birddogsgarage
I do not see an option for the insurance in the admin
Modules
Order total
I just see
Low order fee
Shipping
Sub total
Tax
Total

Bu tI dont see anything resembling the instructions

QUOTE
**********
* STEP 6 *
**********

Activate in admin section of your site (Modules->Order Total) and edit the following settings.

1. Use Shipping Insurance? Set to "True" if you want to use this module.
2. Insure Tax? Set to "True" if you want to insure tax on packages shipped by USPS.
3. Customer Choice? Set to "True" if you desire the shipping insurance checkbox to
default to "unchecked" when the customer arrives at your checkout payment screen.
The customer must choose to SELECT shipping insurance. Set to "False" if you
desire the shipping insurance checkbox to default to "checked" when the customer
arrives at your checkout payment screen. The customer must choose to DESELECT
shipping insurance.
4. Sort Order? Set this to the order you want it to appear in the totals table.
See how your Order Total Modules have a Sort Order? Well, I use Shipping
as 3 and Shipping Insurance as 4. Be careful NOT to have two modules with
the same order number. Note that ANY modules ordered after it, excluding
shipping, will not be included in the total insured.
5. Insert accurate insurance amounts in the appropriate input boxes. You can verify
current rates at the USPS website. Links are provided in the module description.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.