Combined Shipping Discounts
Eric-
Thanks for your support - still having a difficult time getting the shipping over> $100 to be applied to only US ship to countries: everything eles seems to work- all ship to countries with order greater than $100 receive free shipping- which is incorrect but is likely due to the individual shipping rules Total Price <100
I am using the $_SESSION["eCartCheckoutForm_shipping_country"] on the confirm page
here is the shipping rules - there are 4 types of shipping Fedex standard, next day, 2 day, and international - I think those rules may conflict with the free domestic over 100 rule
//start node
function DefineRules() {
$this->Discounts = array();
$this->Charges = array();
$this->Tax = array();
$this->Shipping = array();
$this->ShippingIsTaxed = true;
//Discounts
$this->Discounts[] = new WA_eCart_Rule(urldecode("Free_Shipping_Override"), true, "WAEC_eCart1_Free_Shipping_Override");
$this->Discounts[] = new WA_eCart_Rule(urldecode("Promo%2015%25%20%20Discount"), true, "WAEC_eCart1_15PromoDiscount");
$this->Discounts[] = new WA_eCart_Rule(urldecode("Promo%2020%25%20Discount"), true, "WAEC_eCart1_Pomotional20Discount");
$this->Discounts[] = new WA_eCart_Rule(urldecode("Promo%2025%25%20Discount"), true, "WAEC_eCart1_Promo25Discount");
//Charges
//Tax
$this->Tax[] = new WA_eCart_Rule(urldecode("NJS%20Sales%20Tax"), true, "WAEC_eCart1_NJSalesTax");
$this->Tax[] = new WA_eCart_Rule(urldecode("NYS%20Sales%20Tax"), true, "WAEC_eCart1_NYSSalesTax");
//Shipping
$this->Shipping[] = new WA_eCart_Rule(urldecode("Shipping%20&%20Handling"), false, "WAEC_eCart1_ShippingHandling");
$this->Shipping[] = new WA_eCart_Rule(urldecode("Fedex%20Standard"), true, "WAEC_eCart1_FedexStandard");
$this->Shipping[] = new WA_eCart_Rule(urldecode("Fedex%20Next%20Day"), true, "WAEC_eCart1_FedexNextDay");
$this->Shipping[] = new WA_eCart_Rule(urldecode("Fedex%202%20Day"), true, "WAEC_eCart1_Fedex2Day");
$this->Shipping[] = new WA_eCart_Rule(urldecode("Fedex%20International"), true, "WAEC_eCart1_FedexInternational");
$this->Shipping[] = new WA_eCart_Rule(urldecode("FreeDomesticShippingOver100"), true, "WAEC_eCart1_FreeDomesticShippingOver100");
}
//end node
//start node
//eCart Rule
function WAEC_eCart1_Free_Shipping_Override() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['PromoCode'])?$_SESSION['PromoCode']:"") == "SHIP4FREE"))) {
$totalDiscount += 0.00;//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_15PromoDiscount() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['PromoCode'])?$_SESSION['PromoCode']:"") == "L7ViYvea"))) {
$totalDiscount += ($this->TotalColumn("TotalPrice") * 0.15);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_Pomotional20Discount() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['PromoCode'])?$_SESSION['PromoCode']:"") == "KVGVIP"))) {
$totalDiscount += ($this->TotalColumn("TotalPrice") * 0.20);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_Promo25Discount() {
$totalDiscount = 0;
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['PromoCode'])?$_SESSION['PromoCode']:"") == "CLBuvb6i"))) {
$totalDiscount += ($this->TotalColumn("TotalPrice") * 0.25);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_NJSalesTax() {
$totalTax = 0;
if (true && (($this->GetTaxableTotal() > 0) && ((isset($_SESSION['eCartCheckoutForm_shipping_state_province'])?$_SESSION['eCartCheckoutForm_shipping_state_province']:"") == "New Jersey") || ((isset($_SESSION['eCartCheckoutForm_shipping_state_province'])?$_SESSION['eCartCheckoutForm_shipping_state_province']:"") == "NJ"))) {
$totalTax += ($this->GetTaxableTotal() * 0.070);//Result
}
return WA_eCart_FormatNumber($totalTax, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_NYSSalesTax() {
$totalTax = 0;
if (true && (($this->GetTaxableTotal() > 0) && ((isset($_SESSION['eCartCheckoutForm_shipping_state_province'])?$_SESSION['eCartCheckoutForm_shipping_state_province']:"") == "New York") || ((isset($_SESSION['eCartCheckoutForm_shipping_state_province'])?$_SESSION['eCartCheckoutForm_shipping_state_province']:"") == "NY"))) {
$totalTax += ($this->GetTaxableTotal() * 0.08775);//Result
}
return WA_eCart_FormatNumber($totalTax, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_ShippingHandling() {
$totalShipping = 0;
if (false && ((sizeof($this->Items) > 0))) {
$totalShipping += 10;//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_FedexStandard() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['eCartCheckoutForm_shipping_type'])?$_SESSION['eCartCheckoutForm_shipping_type']:"") == "1") && ($this->TotalColumn("TotalPrice") < 100))) {
$totalShipping += 9.95;//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_FedexNextDay() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['eCartCheckoutForm_shipping_type'])?$_SESSION['eCartCheckoutForm_shipping_type']:"") == "2") && ($this->TotalColumn("TotalPrice") < 100))) {
$totalShipping += 21.95;//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_Fedex2Day() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['eCartCheckoutForm_shipping_type'])?$_SESSION['eCartCheckoutForm_shipping_type']:"") == "3") && ($this->TotalColumn("TotalPrice") < 100))) {
$totalShipping += 14.95;//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_FedexInternational() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['eCartCheckoutForm_shipping_type'])?$_SESSION['eCartCheckoutForm_shipping_type']:"") == "4") && ($this->TotalColumn("TotalPrice") < 100))) {
$totalShipping += 28.50;//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_eCart1_FreeDomesticShippingOver100() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) == 0) && ($this->TotalColumn("TotalPrice") > 100) && ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "US"))) {
$totalShipping += 0.00;//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule