[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Discounts
****** message to minivend-users from Victor Nolton <ven@pragakhan.com> ******
I copied this code from before..
I am looking to change it around a little and was hoping for some help..
What I need to do is take the original amount and discount it 50%
before it goes through the discount fields. Like everything at the
store is 50% off, if they manage to get $5000 worth of stuff (after
the 50% off ) they get 10% off of that. So i am assuming I need to
discount $s 50%. but I don't wanna mess up anything with the way it
is now..
Here is what I use right now.
[discount ENTIRE_ORDER]
$original = $s;
if ($s <= 2499.99) {
$discounted = $s;
} elsif ($s <= 4999.99) {
$discounted = $s * .95;
} elsif ($s <= 9999.99) {
$discounted = $s * .90;
} elsif ($s <= 19999.99) {
$discounted = $s * .88;
} elsif ($s >= 20000.00) {
$discounted = $s * .85;
}
$difference = $original - $discounted;
return $discounted;
[/discount]
Would it have to be like
if (($s * .50) <= 2499.99) {
$discounted = ($s * .50);
} elsif (($s * .50) <= 4999.99) {
$discounted = ($s * .50) * .95;
I would like to pre discount the $s for easier implementing.
Any views on doing this could be appreciated.
Ven
-
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