I'm having trouble following your directions. I edited the calculations as follows:
//start node
function ResetCalculations($itmObj) {
$itmObj->TotalWeight = $itmObj->Weight * $itmObj->Quantity;//w
$itmObj->TotalPrice = 7.5* $itmObj->Quantity;//c
$itmObj->FullDetails = $itmObj->Quantity . ' ' . $itmObj->Name . ' (' . $itmObj->ID . ')';//t
$itmObj->TotalQuantity = $itmObj->Quantity;//n
$itmObj->holidayPrice = 7.5;//c
return $itmObj;
}
//end node
This sets the price for every item to the unit price if there is no discount, $7.50. This part is showing up properly in my cart now.
Next, I redid the tiers to calculate a discount based on how many total items are in the cart. These have the effect of lowering the cart title by the discount in unit price times the total quantity of all items in the cart. This is how they look:
//Discounts
$this->Discounts[] = new WA_eCart_Rule(urldecode("tier1"), true, "WAEC_WA_eCart1_tier1");
$this->Discounts[] = new WA_eCart_Rule(urldecode("tier2"), true, "WAEC_WA_eCart1_tier2");
$this->Discounts[] = new WA_eCart_Rule(urldecode("tier3"), true, "WAEC_WA_eCart1_tier3");
//Charges
//Tax
//Shipping
$this->Shipping[] = new WA_eCart_Rule(urldecode("base"), false, "WAEC_WA_eCart1_base");
$this->Shipping[] = new WA_eCart_Rule(urldecode("increment"), false, "WAEC_WA_eCart1_increment");
}
//end node
//start node
//eCart Rule
function WAEC_WA_eCart1_tier1() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) >= 5) && (sizeof($this->Items) < 10))) {
$totalDiscount += ($this->TotalColumn("TotalQuantity") * .5);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_WA_eCart1_tier2() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) >= 10) && (sizeof($this->Items) != 20))) {
$totalDiscount += ($this->TotalColumn("TotalQuantity") * 1.0);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_WA_eCart1_tier3() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 20))) {
$totalDiscount += ($this->TotalColumn("TotalQuantity") * 1.5);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
Finally, I add a line in the cart to display the discount, using this binding: <?php echo $WA_eCart1->GetDiscounts(); ?>.
However, the discount does not show up and the total is not affected. I have the tier rules selected as active, but obviously, they are not.
Help, please?