[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] MV 3.14 - Discount Pricing Scheme
****** message to minivend-users from "Russ Mann" <tech@khouse.org> ******
Hello List,
I am trying to implement a very interesting pricing discount scheme.
On my store I sell several different categories of products. In one of
these categories only, i need to implement a pricing structure like this:
Qty. Price Ea.
1-2 = 11.96
3-9 = 10.00
10+ = 9.50
I've tried several things, but the DISCOUNT tag seems to have a lot of
limitations not allowing it to work with variables generated in the [calc]
tags or by [scratch] variables.
using the following code, i am able to get a total quantity of the products
in the category that i am discounting (they all have a covertype of 'Audio
Tapes' in the database.)
[item-list]
<!-- [calc]
if ('[item-field covertype]' eq 'Audio Tapes') { $totalbps +=
[item-quantity]; }
[/calc] -->
[/item-list]
The problem comes when i try to implement this in the discount section:
[discount ENTIRE_ORDER]
if (($totalbps >= 3) && ($totalbps <=9)) { $numoff = 1.96; }
elsif ($totalbps >= 10) { $numoff = 2.46; }
else { $numoff = 0; }
$dollarsdiscount = $totalbps * $numoff;
return($s - $dollarsdiscount);
[/discount]
This doesn't work, and presumably because it cannot access $totalbps from
within the discount tag.
How can i access this [calc] variable within the discount tag?
How can i display the discount that is applied to the ENTIRE_ORDER?
Thank you,
Russ Mann
-
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