You can use the following methods to provide discounts for loyal clients:
# ID of the FE user group [usergroup = 1] priceNoReseller = 2 [global]
pricecalc { 10.type = count 10.field = price # Product with with ID 16 will be with 20% discount 10.where = uid = 16 # Full price is 1, so we set the 80% of full price 10.prod.1 = 0.8 }
pricecalc { 10.type = count 10.field = price 10.sql.where = 10.prod.1 = 4.99 10.prod.2 = 8.99 10.prod.5 = 19.99 }
Using the discount field can take too much time because you have to enter these values individually. In this way, user discounts are difficult to overview. If a user amount grows, it then will be more difficult to administrate the discount values if you change it. You can use this method only for special VIP clients who need these values.
If you use field price2, you can specify a global value (user group) that will be used for clients' group discount calculation:
[usergroup = 1] plugin.tt_products.priceNoReseller = 2 plugin.tt_products.getDiscountPrice = 1 [global] plugin.tt_products.discountprice { 10.type = count 10.field = price2 10.additive = 0 10.sql.where = 10.prod.1 = 18.25 10.prod.10 = 17.04 }