[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Multiple Salestaxes
****** message to minivend-users from mikeh@minivend.com ******
Quoting billb (billb@vrmetro.com):
> Hi all,
> I have a new problem. One of the catalogs I set up is for a
> Tobacco shop. The shop is located in Michigan, which has a 16%
> tobacco sales tax on top of our normal 6% sales tax.
>
> I have the checkout.html detecting if an item ordered is a
> tobacco product. Now I need the right direction to head in so
> that I can either place perl code that will calculate the tax for
> that specific item, or a way to call a routine that can. In both
> cases, the code to do such a thing eludes me.
>
> I may be totally off on this as it may not be possible at all. I
> would really rather not make a seperate catalog just for MI
> buyers that would have the products just tagged as nontaxable and
> incorporate the tax into the price if I don't have to. Could
> someone point me in the right direction with this? Any help would
> be greatly appreciated.
>
I see lots of questions like this, perhaps this can be made into
an FAQ (if I ever get some time!).
This is where mv_handling is supposed to help.
In catalog.cfg:
Variable CHECK_TOBACCO <<EOF
[calc]
[item-list]
[if-data products tobacco]
[item-subtotal noformat] +
[/if-data]
[/item-list]
0;
# Add 0 to make calculation come out OK with trailing plus.
[/calc]
EOF
In shipping.asc:
tobacco Tobacco Tax __CHECK_TOBACCO__ 0.01 100000 f @@TOTAL@@ * .16
In your products.asc, add a field "tobacco" that is set non-blank
if a tobacco product.
And finally in your checkout before your total calculation:
[if value state eq 'MI']
<!-- Set tax for MI: [value name=mv_handling set="tobacco"] -->
Tobacco tax for MI: [shipping tobacco]
[else]
[value name=mv_handling set=""]
[/else]
[/if]
There are other ways to do this type of thing, notably writing
a cart parsing routine that adds another item (nontaxable!) to
the cart.
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
131 Willow Lane, Floor 2 | || _ \
It's a little-known fact Oxford, OH 45056 | || |_) |
that the Y1K problem caused <mikeh@minivend.com> |___| _ <
the Dark Ages. -- unknown 513.523.7621 FAX 7501 |_| \_\
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list