Multiple shipping costs not working properly
On https://www.ilgrappolo.ch/de/shop/weine/index.php
I've added the following rules for calculationg the shipping costs (Lieferkosten):
1-8 total items AND grand total < 800 -> Flat rate 12
9-12 total items AND grand total < 800 -> Flat rate 17
13-24 total items AND grand total < 800 -> Flat rate 34
25-36 total items AND grand total < 800 -> Flat rate 148
>37 total items OR grand total >= 800 -> Flat rate 0
//start node
function DefineRules() {
$this->Discounts = array();
$this->Charges = array();
$this->Tax = array();
$this->Shipping = array();
$this->ShippingIsTaxed = false;
//Discounts
//Charges
//Tax
//Shipping
$this->Shipping[] = new WA_eCart_Rule(urldecode("1-8%20Flaschen"), true, "WAEC_eCart_ilGrappolo_18Flaschen");
$this->Shipping[] = new WA_eCart_Rule(urldecode("9-12%20Flaschen"), true, "WAEC_eCart_ilGrappolo_912Flaschen");
$this->Shipping[] = new WA_eCart_Rule(urldecode("13-14%20Flaschen"), true, "WAEC_eCart_ilGrappolo_1314Flaschen");
$this->Shipping[] = new WA_eCart_Rule(urldecode("25-36%20Flaschen"), true, "WAEC_eCart_ilGrappolo_2536Flaschen");
$this->Shipping[] = new WA_eCart_Rule(urldecode("ab%2037%20Flaschen"), true, "WAEC_eCart_ilGrappolo_ab37Flaschen");
}
//end node
//start node
//eCart Rule
function WAEC_eCart_ilGrappolo_18Flaschen() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) <= 8) && ($this->TotalColumn("TotalPrice") < 800))) {
$totalShipping += floatVal("12");//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart_ilGrappolo_912Flaschen() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) > 8) && (sizeof($this->Items) <= 12) && ($this->TotalColumn("TotalPrice") < 800))) {
$totalShipping += floatVal("17");//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart_ilGrappolo_1314Flaschen() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) > 12) && (sizeof($this->Items) <= 24) && ($this->TotalColumn("TotalPrice") < 800))) {
$totalShipping += floatVal("34");//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart_ilGrappolo_2536Flaschen() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) > 24) && (sizeof($this->Items) <= 36) && ($this->TotalColumn("TotalPrice") < 800))) {
$totalShipping += floatVal("48");//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart_ilGrappolo_ab37Flaschen() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) > 36) || ($this->TotalColumn("TotalPrice") >= 800))) {
$totalShipping += floatVal("0");//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//end node
It looks like only the first rule works or if the grand total is bigger the 800. What am I doing wrong? Thanks for any help