Disount Code from a recordset
Hi Guys, I amended the discount code to look up a discount voucher value via recordset. I get an undefined variable error.
The code is below. Before I amended the code the voucher was hard coded and checked against a session created when person put in a valid code. Worked fine. To enable the site owner to change these codes on a whim I set up a dataabse table to hold the voucher. I then created a recordset in eCart1_PHP.php and changed the below. I know the variable $discountcode gets the correct value but On the cart page its says undefined. Any help really appreaciated. I have put 3 # sybols in front of and at the end of the code I inserted to help you see what I changed.
function WAEC_eCart1_discountRule() {
$totalDiscount = 0;
#####$discountcode = $row_Recordset1['voucher'];####
if (true && ((sizeof($this->Items) > 0) && ((isset($_SESSION['coupon'])?$_SESSION['coupon']:"") == ###$discountcode###))) {
$totalDiscount += ($this->ConditionalTotal("TotalPrice", "sale", "no") * 0.20);//Result