Discount with different triggers.
Customers can fill in a textfield for a sticker (text-decal).
I want to make a discount when the customer orders more than 2 pieces* of this item (ID 829), but the column values "Size" & "EigenTekst" (textfield) has to be the same.
* 3-5 pcs : -20% * 6-9 : -30% * >=10 : -35%
I can't make this trigger in the eCart Object.
The trigger I already have is just a little start. Now it checks only when quantity = 3 and when Size = 15 cm, but Sizes are from 5 tot 100 cm in steps of 5 cm.
The discount result now (for testing) is the "TotalPrice"/2, but it must be calculated on the above conditions.
Is it possible to let this work ?
<%
function WAEC_stickersBE_MoreThanOne()
totalDiscount = 0
if (true AND ((WA_eCart_ConditionalTotal(stickersBE, "Quantity", "ID", "829") = 3) AND (WA_eCart_ConditionalTotal(stickersBE, "Quantity", "Size", "15") = 3))) then
totalDiscount = totalDiscount + (WA_eCart_ConditionalTotal(stickersBE, "TotalPrice", "ID", "829") / cDbl(2))'Result
end if
WAEC_stickersBE_MoreThanOne = WA_eCart_FormatNumber(totalDiscount, stickersBE.ForceDecimalsC, stickersBE.DecimalPlacesC)
end function
%>
Geert.
WAeCart 4.5.2 - Asp Vbscript