show if db coupon code has expired in ecart
Hello,
Attempting to do a show if based on database coupon codes. Each code has an expire date. All is working in the cart. My goal is to have this message show if they put in an expired coupon: Your coupon has expired.
So far I have this:
<?php if ($row_rsCoupondb['expDate'] > 0) { // Show if recordset empty ?>
<div class = "couponmsg">Coupon Code <?php echo $row_rsCoupondb['couponCode']; ?> expires, on <?php echo $row_rsCoupondb['expDate']; ?>.
This gives customer coupon expiration info when they enter the code and submit it.
I tried this code hoping it would give the message if the entered coupon is expires, but I dreamweaver is telling me my code is in error. I took the code after the first part from the cart function php page where the discount rules are. Thought that made sense, but it is in error:
<?php if ($totalRows_rsCoupondb > 0) && (isset($_SESSION['expDate'])) && (time() <= strtotime($_SESSION['expDate'])) { // Show if recordset not empty ?>
Your coupon has expired
<?php } // Show if recordset not empty ?>
Is this possible to do?
Thank you,
K