Only allow one discount code to be used
Hi Ray, I know I'm probably missing something really simple, but how would I prevent users applying multiple discount codes? I have an automatic 30% discount code on a site which kicks in if the user orders 10 or more books, however my client wants to offer a 50% discount on one book. I don't want users to be able to apply this discount in addition to the 30% discount.
I tried this but it doesn't stop users adding the additional code:
//eCart Rule
function WAEC_Cart_BOOK50OFF() {
$totalDiscount = 0;
if (true && (($this->InCart("6") == true) && ((isset($_SESSION['PromoCode'])?$_SESSION['PromoCode']:"") == "BOOK50") && (!isset($_SESSION['BIGBUNDLE30'])))) {
$totalDiscount += floatVal("6.50");//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule