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 1 of 2
Goto page 1, 2  Next
non-taxable items
Author Message
Reply with quote
Post non-taxable items 
I plugged the code mentioned in the "othertaxinfo..." file (located in the download section of the free forum) into my cart to make certain items nontaxable (after placing "exempt" in the User5 field in the database), and sure enough those items were not taxed, but the tax was totally screwed up on everything else! Any ideas? Would custom tax logic apply here?
Also I saw mentioned somewhere (darned if I can find it now) you can individually set the tax rate for each item in the database. I wouldn't mind doing this, but I heard the other method was simpler, and I couldn't get that to work.
Any help is appreciated.
Denny
p.s. - I'd like to think I'm not a total idiot, but go ahead & reply to this like I am since I'm NOT a PERL programmer!!!

View user's profile Send private message
Reply with quote
Post  
MODERATED
The quoted code below does not work! Don't waste your time trying to make it run. Read the subsequent posts for clarification. A solution to this matter that works is located in the Yahoo! Free Forum in the "Files" section. Posted by Mark S. (Throwaway).
Regards,
Dan




Here is a re-post of some information I found on how to set up tax exempt items.

Quote:
This was tested on agoracart v 4.0K-4b Standard. so it
should work fine for all previous versions as well.
if you have customized your tax routine prior to adding
this file you will probably need to make some adjustments
to this file or wherever else it is necessary.
be sure you use a plain text editor to edit these files!
you need to download your store/library/agora_order_lib.pl
via ftp in ascii and make a backup copy just incase things
go wrong. copy from this file everything between the # lines.
then paste and replace the entire "sub calculate_sales_tax"
in the agora_order_lib.pl file. upload and overwrite the
store/library/agora_order_lib.pl via ftp in ascii.
then,
log into your manager and edit the all the products you
need to exempt tax for by adding in user5 the word "exempt"
without the quotes. test for function. you probably should
test with the offline orderform. taxes will not be added
until you declare your state in the orderform and submit.
sub calculate_sales_tax {
local($subtotal) = @_;
local($sales_tax) = 0;
local($tax_form_variable);
local($continue)=1;
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");
}
&codehook("calc_sales_tax_top");
if ($continue == 0) {
return (&format_price($sales_tax));
}

$tax_form_variable = $form_data{$sc_sales_tax_form_variable};
if ($tax_form_variable eq "") {
$tax_form_variable = $vform{$sc_sales_tax_form_variable};
}

if ($sc_sales_tax_form_variable ne "") {
foreach $value (@sc_sales_tax_form_values) {
if (($value =~
/^${tax_form_variable}$/i) &&
(${tax_form_variable} ne "")) {
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];
&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;
}
}
close(CART);
}
}

} else {
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];
&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;
}
}
close(CART);
}

&codehook("calc_sales_tax_bot");
return (&format_price($sales_tax));

}
############################################################

and then I updated the the items that I wanted to be exempt through
the store manager.


Reply with quote
Post  
Ralph,
Looking over this code, perhaps it could also be used for tax exempt ordering when a state reseller's ID is inputted?
But it wouldn't be based on the user 5 field, or any user field of the database, but would be based on a check box being checked on the order form.
Any ideas as to how I might change this snippet of code to do that?

TIA!


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post don't start building on this code yet... 
this is the code I used in my cart & couldn't get it to work. I've seen several other posts of others than couldn't get it to work for them, but no posts of users who had it working. So beware.

View user's profile Send private message
Reply with quote
Post  
Hi Bonnie,

Can't help you with that. I don't use any tax logic on my store, as the Tax Manager has everything I need, and haven't had the time to learn the advanced phases. Somewhere in one of the forums, most likely one of the Pro, I think there is some logic for handling reseller accounts, but with my feeble mind I may be dreaming..... <LOL>

Reply with quote
Post  
Hi Denny,

Thanks for the FYI...... Maybe someone will respond who has found a fix for it.

Reply with quote
Post tax exempt 
hell-o
that info was posted by me. it was taken directly out of the store/protected/docs.
i elaborated a little on it and tested it. it works! as stated in the message.
if it doesn't work for you then you may have other configurations that are interferring or you have implimented it improperly.
try it again and check your error log in the manager.
tell me what it isn't doing or what is happening.
regards,
dan

Reply with quote
Post tax exempt 
I just now did a fresh download & install of the latest version of Agora(just in case I had made a tweak on the last install causeing the problem) , cut & paste the code in the above response (instead of the one in the othertaxinfo...zip file), & got the same response - "exempt" items don't get taxed, taxes are totally off on all other items (with no discernable pattern or tax rate).
Checked error log & it was empty. Perhaps your agora_order_lib.pl was not "stock" before making this change? Dunno. But I'd be very interested in hearing from anyone else getting it to work since I've heard of several unsuccessful attempts.
FYI, the link to the new install is:
http://www.ClickHereForAGreat.com/ecom/store
Tax state is Illinois - 6.75% (taxes worked fine before code modification)
The first Perl book (Learning Perl) is set up as nontaxable.

View user's profile Send private message
Reply with quote
Post  
hell-o
i went to your store and this is the result i got:

1 Learning Perl $ 20.00
1 Programming Perl (2nd Edition) $ 35.96

Order Totals
Item Cost Subtotal: $ 55.96
Sales Tax: 2.43

Grand Total: $ 58.39

i added learning perl and checked...no tax
then went back and added programming perl and got the above results.


i went back and added more:

1 Learning Perl 5 $ 20.00
1 Programming Perl (2nd Edition) $ 35.96
1 Dynamic HTML: The Definitive Guide $ 31.96

Order Totals
Item Cost Subtotal: $ 87.92
Sales Tax: 4.58

Grand Total: $ 92.50



i went back and removed all items. then added randomly:

1 Learning Perl 5 $ 20.00
1 Perl and CGI for the World Wide Web $ 15.19
1 HTML: The Definitive Guide $ 27.96
1 HTML Goodies $ 15.99

Order Totals
Item Cost Subtotal: $ 79.14
Sales Tax: 3.99

Grand Total: $ 83.13


i went back, removed all items then added items excluding the exempt product:


1 Perl Cookbook $ 31.96
1 Mastering Regular Expressions $ 20.00
1 Dreamweaver 2 Bible $ 31.99

Order Totals
Item Cost Subtotal: $ 83.95
Sales Tax: 5.67

Grand Total: $ 89.62



am i missing something?

regards,
dan

Reply with quote
Post non taxable 
hell-o
denny. are you getting the same incorrect results?
you said:

"taxes are totally off on all other items (with no discernable pattern or tax rate). "

are you still getting those results? what exactly are you doing to get those results?

regards,
dan

Reply with quote
Post RE: non taxable 
hell-o

hey denny, ya there?
still havin probs with the code? would like to know where you're at with this thing.

regards,
dan

Reply with quote
Post  
Dan - sorry for not responding sooner - for some reason I wasn't notified by email of your response (and I've been checking!!). Perhaps I'm getting a handle on what's going on after I see your test results. There may be a glitch in multiple quantity purchases (haven't tested thoroughly yet, wanted to hurry up & write you due to my delay thus far in doing so).

I notice all your tests have been with a quantity of 1. In the Perl books, I set the price to $20 for the first & last book, the first one tax exempt, the latter taxed. That way, I just buy 5 of each & it's easy to see what tax rate is being levied (tax on $100 at 6.75% is $6.75, etc). Well, here's the kicker, with a $200 purchase (half of which is taxable), the tax should be $6.75, but it comes out as $1.35!!! This, by the way, is the tax on 1 $20 item!! It appears that only single quantities are being taxed on multiple quantity purchases. Check it out man & let me know what you find...

View user's profile Send private message
Reply with quote
Post RE: non taxable 
hell-o
thanks for the response! it's great to get feed back other than "it doesn't work". LOL and thanks for taking the time.

i deleted my posted file from the free forum so as to not waste anyone elses time. i suppose i was too hasty to test it better.

there is a properly scripted hack posted by mark s. he does good work so it's sure to work. think it's in the pro forum. so, since there is an existing working version there's really no sense persuing this one.

apologies to those who attempted to use it!

regards,
dan

probably wouldn't take much to correct it as is though :-))

Reply with quote
Post tax exempt solved??? 
Hi again Dan
I don't know Perl so I hope this code is legit, but I added the variable $quantity to 2 lines & it seems to work. The 2 lines were both:
$sales_tax = $sales_tax + $my_subtotal * $sc_sales_tax * $quantity;

Also 1 question: isn't the second "$sales_tax +" above unnecessary since it is zeroed out at the top? I want to take it out if not needed.

Later
Denny

View user's profile Send private message
Reply with quote
Post disregard above post 
Never mind - still doesn't work. Time to throw in the towel & belly up to the pro forum bar.

Denny

View user's profile Send private message
Reply with quote
Post  
Does this code work or not? I tried it for www.yinstyle.com since in MA clothing under $175 (for example, our jackets) are exempt. It didn't work. Any advice?


_________________
Michael H. Cohen
www.camlawblog.com
View user's profile Send private message
Reply with quote
Post  
i'm not sure if it works... but Mark created a nice exemptoin hack that's available to lifetime members.... from what i gather it works like a charm

Reply with quote
Post  
sorry if this seems naiive ... but where would that be found? If I'm in agora pro am I a Lifetime member?


_________________
Michael H. Cohen
www.camlawblog.com
View user's profile Send private message
Reply with quote
Post  
Is this it? calculate_sales_tax_override.pl in the mas hysteria files of yahoo groups? I copied code into the agora_order_lib.pl ...

Still doesn't work...


_________________
Michael H. Cohen
www.camlawblog.com
View user's profile Send private message
Reply with quote
Post  
from Yahoo Pro Forum files section:

mas_hysteria/mas_count_me_out.zip

Reply with quote
Post  
hell-o
the code had a minor flaw in it. someone apparently posted a fix but i failed to see it before deleting the file from the yahoo! free forum.
as eric said mark had recoded the routine so it wasn't so clunky. his version was a result on my non working version which is why i opted to delete mine.
i believe you can find it in the yahoo! free forum under the "files" link.
regards,
dan

Reply with quote
Post  
Just to be clear:
Use "count me out.zip" which is the correct file?


_________________
Michael H. Cohen
www.camlawblog.com
View user's profile Send private message
Reply with quote
Post  
yuppers that be the one you want

Reply with quote
Post Can't find the file 
Dan wrote:
hell-o
the code had a minor flaw in it. someone apparently posted a fix but i failed to see it before deleting the file from the yahoo! free forum.
as eric said mark had recoded the routine so it wasn't so clunky. his version was a result on my non working version which is why i opted to delete mine.
i believe you can find it in the yahoo! free forum under the "files" link.
regards,
dan


Dan - I don't seem to see the file. Is it somewhere else? I offer gift certificates that aren't taxable.

Thanks,
Mylo

View user's profile Send private message Visit poster's website
Reply with quote
Post RE: Can't find the file 
hell-o
aparrently this hack is in the pro forum files section.
"calculate_sales_tax_override.pl"
maybe i will resurrect my version and apply the suggested fix. it will need extensive testing. or, just become a lifer and have access to a bunch of cool hacks and stuff.
regards,
dan

Display posts from previous:
Reply to topic Page 1 of 2
Goto page 1, 2  Next
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