Thanks Jason, but that's the same for this application as using the ID method as far as I can see.
There are four batches of 60 drills, each batch with different characteristics, and so I'm back to the same situation, 240 drills and each batch of 60 with 8 quantity discount formulas.
At present the wizard works using a drill's ID, as that separates each item in the cart for it's own discount calculation.
Here is the current code from the wizard for 2 rules I have set up:
//Discounts
$this->Discounts[] = new WA_eCart_Rule(urldecode("SterileShortAOConnect"), true, "WAEC_CingleCart_SterileShortAOConnect");
$this->Discounts[] = new WA_eCart_Rule(urldecode("SterileLongAOConnect"), true, "WAEC_CingleCart_SterileLongAOConnect");
//Charges
//Tax
$this->Tax[] = new WA_eCart_Rule(urldecode("GST"), true, "WAEC_CingleCart_GST");
//Shipping
}
//end node
//start node
//eCart Rule
function WAEC_CingleCart_SterileShortAOConnect() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && ($this->ConditionalTotal("Quantity", "ID", "20") >= 100) && ($this->ConditionalTotal("Quantity", "ID", "20") < 499) && ($this->ConditionalTotal("Quantity", "PriceCategory", "1") > 0))) {
$totalDiscount += ($this->ConditionalTotal("Quantity", "ID", "20") * 2.5);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_CingleCart_SterileLongAOConnect() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && ($this->ConditionalTotal("Quantity", "ID", "26") >= 100) && ($this->ConditionalTotal("Quantity", "ID", "26") < 499) && ($this->ConditionalTotal("Quantity", "PriceCategory", "2") > 0))) {
$totalDiscount += ($this->ConditionalTotal("Quantity", "ID", "26") * 3.30);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
If I could get the code to automatically source the ID of a drill bit from the item in the cart, (ID's are 20 & 26 in the above code) it would work OK.
Is this possible ??
Or is there a better method that I am not seeing?