Discounts in cart code one time instead of for each ID possible ?
For each items in our database of products, I have to add the code to apply the discount for the specific ID of the product. Is there a way to not have to do it for each one? instead have the discount apply to all that share a common trait..For example any that starts with 'WB-' ?
If not, is there to automatically add the code below with the ID when a product is added to our database (simultaneously)? (in the file eCart1_PHP.php)
//eCart Rule
function WAEC_eCart1_QuantityDiscount646() {
$totalDiscount = 0;
if (true && (($this->ConditionalTotal("Quantity", "ID", "4190") >= 6) && ($this->ConditionalTotal("Quantity", "ID", "4190") <= 10))) {
$totalDiscount += (floatval($this->GetInfo("4190", "TotalPrice")) * 0.05);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
function WAEC_eCart1_QuantityDiscount647() {
$totalDiscount = 0;
if (true && (($this->ConditionalTotal("Quantity", "ID", "4190") >= 11) && ($this->ConditionalTotal("Quantity", "ID", "4190") <= 20))) {
$totalDiscount += (floatval($this->GetInfo("4190", "TotalPrice")) * 0.1);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
function WAEC_eCart1_QuantityDiscount648() {
$totalDiscount = 0;
if (true && (($this->ConditionalTotal("Quantity", "ID", "4190") >= 21))) {
$totalDiscount += (floatval($this->GetInfo("4190", "TotalPrice")) * 0.15);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
Maybe you can give me an idea on what to do. Thank you.