Hi all.
I am trying to create a code that will give 10% but only on a Tuesday!
Any ideas how to achieve this?
Cheers
Hi all.
I am trying to create a code that will give 10% but only on a Tuesday!
Any ideas how to achieve this?
Cheers
Well, I thought either there was ZC code that could return the day of the week, if not there is php code thatcould do the same. Would need to insert inline with the discount code verification a check of the day of the week (should advise customers what time zone it isbased on) and allow/disallow the disount
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Umm sounds beyond my abilities. Or at least at present. I thought this would be easy.
As a temp work around I am setting it using the valid dates. This means weekly added admin and is at risk of not being done. As for time zones can be dismissed as a local business only trading in one county.
You could do this by adding the code in RED to the file:
/includes/modules/order_total/ot_coupon.php
NOTE: the echo in there is for testing so you can change the Day of the Week to make sure that things are working for you, before Tuesday ...Code:// bof: coupon 10OFFTUESDAY valid on Tuesday only echo 'ot_coupon says cc_id: ' . $_SESSION['cc_id'] . ' redeem code: ' . $dc_check . ' Day of Week: ' . date('D') . '<br>'; if ($dc_check == '10OFFTUESDAY' && date('D') != 'Tue') { $foundvalid = false; } // eof: coupon 10OFFTUESDAY valid on Tuesday only if (!$foundvalid) { $this->clear_posts(); }
Just add the // in front of the echo to turn the echo off ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Would be interesting to see this type of "option" in a plugin, if it doesn't already exist. Ideally, wouldn't want to have to hard code the coupon/day/date, but might want to have a configurable admin switch to leave behind an indication of what would need to be edited to remove/change/add to the coupon. Of course you are also keeping notes of the changes made, right?
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
You could also just set the dates to manage this every week ... this just removes the labor ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Bookmarks