Discount Rule Help
I have a discount rule for buy 6 and get the cheapest free that looks like this:
//eCart Rule
function WAEC_eCart1_Buyany6TTProductsandgettheCheapest1Free() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && (( ((($this->ConditionalTotal("Quantity", "TypeID", "1")) + ($this->ConditionalTotal("Quantity", "TypeID", "2")) + ($this->ConditionalTotal("Quantity", "TypeID", "3")) + ($this->ConditionalTotal("Quantity", "TypeID", "4")) + ($this->ConditionalTotal("Quantity", "TypeID", "5")) + ($this->ConditionalTotal("Quantity", "TypeID", "7")) + ($this->ConditionalTotal("Quantity", "TypeID", "8")) + ($this->ConditionalTotal("Quantity", "TypeID", "9")) + ($this->ConditionalTotal("Quantity", "TypeID", "10")) + ($this->ConditionalTotal("Quantity", "TypeID", "12")) + ($this->ConditionalTotal("Quantity", "TypeID", "16")) + ($this->ConditionalTotal("Quantity", "TypeID", "17")) + ($this->ConditionalTotal("Quantity", "TypeID", "18")) + ($this->ConditionalTotal("Quantity", "TypeID", "19"))) >= 6) )))) {
$totalDiscount += $_SESSION['tt6get1'];//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
where I am checking the quantity of the Product Type ID column in the cart which works great if a single line total of the Product Type ID is greater than or equal to 6 BUT I would like it to work if the sum of the Product Type ID line totals is greater than or equal to 6.
How can I make a rule that can do this please.