I found this in the posts in the Yahoo group. I tested it on my site and it seems to work OK.
The change is made in ../store/library/agora_order_lib.pl
# This should work on old and new versions of agora.cgi and commerce.cgi.
# In the sub calculate_sales_tax there is this logic:
# A match results in the sales tax
# being calculated.
if ($sc_sales_tax_form_variable ne "") {
foreach $value (@sc_sales_tax_form_values) {
if (($value =~
/^$form_data{$sc_sales_tax_form_variable}$/i) &&
($form_data{$sc_sales_tax_form_variable} ne "")) {
$sales_tax = $subtotal * $sc_sales_tax;
}
}
# At the top of that sub, after the statment " local($continue)=1; "
# add the following lines of code
local ($inx,$product_id,$my_subtotal,$temp);
local (@my_cart_fields,@my_db_row);
if (!($sc_db_lib_was_loaded =~ /yes/i)) {
&require_supporting_libraries (__FILE__, __LINE__, "$sc_db_lib_path");
}
# Those statements setup unique variables and load the database library if
# it is not already loaded. Next, change the line in the above logic
# $sales_tax = $subtotal * $sc_sales_tax;
# to the following
open (CART, "$sc_cart_path") || &file_open_error("$sc_cart_path",
"calculate tax",__FILE__, __LINE__);
while (<CART>) {
chop;
$temp = $_;
@my_cart_fields = split (/\|/, $temp);
$inx = $cart{"price_after_options"};
$my_subtotal = $my_cart_fields[$inx];
$inx = $cart{"product_id"};
$product_id = $my_cart_fields[$inx];
$inx = $cart{"quantity"};
$my_quantity = $my_cart_fields[$inx];
&check_db_with_product_id($product_id,*my_db_row);
$testval = $my_db_row[$db{"user5"}];
if (!($testval =~ /exempt/i)) {
$sales_tax = $sales_tax + $my_subtotal * $sc_sales_tax * $my_quantity;
}
}
close(CART);
# This loops through the cart and assigns tax only if user5 field does
# not have the word "exempt" in it based on the method described above