The Official Website of AgoraCart and Agora.cgi
AgoraCart.com Demos Download AgoraCart User Manuals & Wiki Gold Members Forum Go Gold Now! Gold Version Memberships

AgoraCart.com

About
Features
Download
Payment Gateways
Send a Donation
Founders Club
BLOG: News & Updates

Showcases & Demos

AgoraCart Demos
Shop Live Stores

Downloads & Add-ons

Gold Version Downloads
DBwizz Database Mgr.
AgoraCart.com Store

Help & Support

User Manuals
Gold Version Users Forum
Gold Version Chat
Tech Support
Certified Agora Pros
Certified Designers
Hire a Freelancer

Gold Version Members

Member Benefits
Join Today!
Gold Members Home
Gold Version Users Forum
Gold Version Chat Rooms
Gold Version Downloads

For Store Owners

Merchant Accounts
Cool Resources
Advertise Here
"Powered by" Logos
Web Hosting Search

Misc.

Contact Us
MEET's Talking Guide
The Ancient Greek Agora






AgoraCart Free User Forums

This is the official FAQ and Cool Tips guide For the AgoraCart shopping Cart software


Official Sponsors of the AgoraCart Project:

       


RegisterSearchFAQLog in
Reply to topic Page 2 of 2
Goto page Previous  1, 2
non-taxable items
Author Message
Reply with quote
Post non taxable 
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

View user's profile Send private message Visit poster's website
Display posts from previous:
Reply to topic Page 2 of 2
Goto page Previous  1, 2
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum