More on - Tax Problem with tax = 1 : LUSENET : S-Mart Shopping Cart : One Thread

Here is the problem in more detail:

The cgi script calulates the cart for the web page and again (twice) for the emails. In the email part of the script, taxes are currently calculating off $taxamt (from smart.cfg) which is a user defined fixed amount intended for an across the board single fixed tax rate.

In the cgi script, it appears that the author tries to convert $taxamt to accept a variable from tax by state if the user wants ($tax = 1). However, there is a problem and the script just picks up the $taxamt as defined in smart.cfg.

My knowledge of Perl is not good enough to correct this problem.

I have tried to copy and convert the tax calculation from the web part of the script to the mail part, I was not sucsessful. I have tried various other remedies also without success.

Since the author no longer seems interested in supporting the script, it will be up to the users to chip in and help resolve this and other problems that occur.

That's it, I hope to hear from someone soon.

Thank you.

-- Stephen Warriner (, January 23, 2000


Steve: You are exactly right. So the answer is to change $taxamt to $taxamt_1 in the ($tax=1) routine, as follows: ================================================ if ($tax eq '0') { # Do nothing } elsif ($tax eq '1') { if ($taxes{$FORM{'state'}}) { $taxamt_1 = $taxes{$FORM{'state'}}; } $taxtotal = $totalprice * $taxamt_1; $totalprice += $taxtotal; } elsif ($tax eq '2') { $taxtotal = $totalprice * $taxamt; $totalprice += $taxtotal; } ========================================== This fixed it for me.

-- Gregory Swofford (, January 24, 2000.

Thank you Greg! And thanks to everyone else who responded. Got it going.


-- Stephen Warriner (, January 24, 2000.

Moderation questions? read the FAQ