Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2013
    Location
    Dorset, UK
    Posts
    121
    Plugin Contributions
    0

    help question Discount code resricted to Tuesday only?

    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

  2. #2
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Discount code resricted to Tuesday only?

    Quote Originally Posted by SpaceMonkey View Post
    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...

  3. #3
    Join Date
    Nov 2013
    Location
    Dorset, UK
    Posts
    121
    Plugin Contributions
    0

    Default Re: Discount code resricted to Tuesday only?

    Quote Originally Posted by mc12345678 View Post
    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
    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.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Discount code resricted to Tuesday only?

    You could do this by adding the code in RED to the file:
    /includes/modules/order_total/ot_coupon.php

    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();
            }
    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 ...
    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!

  5. #5
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Discount code resricted to Tuesday only?

    Quote Originally Posted by Ajeh View Post
    You could do this by adding the code in RED to the file:
    /includes/modules/order_total/ot_coupon.php

    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();
            }
    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 ...
    Just add the // in front of the echo to turn the echo off ...
    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...

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Discount code resricted to Tuesday only?

    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!

 

 

Similar Threads

  1. Discount code in email
    By batjammin in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 7
    Last Post: 27 Jan 2011, 07:20 PM
  2. This product was added to our catalog on Tuesday 28 September, 2010.
    By ttmb33 in forum Customization from the Admin
    Replies: 1
    Last Post: 30 Sep 2010, 02:16 AM
  3. Can I set a discount for 9 select items which are only redeemable with a coupon code?
    By Colema in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 9
    Last Post: 3 Jul 2010, 07:58 PM
  4. Discount Code - Invalid Code Message Not Appearing - FEC
    By pennylane in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Jan 2010, 11:21 PM
  5. offering a discount by a code
    By organicolive in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 7
    Last Post: 17 Mar 2007, 06:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR