Results 1 to 10 of 199

Threaded View

  1. #11
    Join Date
    Jun 2014
    Posts
    138
    Plugin Contributions
    0

    Default Re: Discount Coupon Guide?!

    Quote Originally Posted by Ajeh View Post
    If the Store Owner marks the Discount Coupon as Inactive by deleting it, then it is flagged deleted ...

    If it just expires, that is not being marked as Deleted, just as not being usable ... if the Store Owner changes the expiration date, then the Discount Coupon is valid ... to this is purely a Store Owner choice to mark the Discount Coupon as Deleted ...

    Once the Store Owner marks the Discount Coupon as Deleted, there is NOT an option to Un-delete the Discount Coupon by the Store Owner. This is when the database would need to be hacked ...
    Hi Linda,
    Because I needed to be able to reactivate discount coupons from admin, I made a few simple changes to do the job.
    In ZC1.5.4 admin/coupon_admin.php around line 112:
    PHP Code:
    //jpda: bof toggle coupon_active instead of setting to 'N' always
          // get current status
          
    $ca_sql $db->Execute("select coupon_active from " .TABLE_COUPONS " where coupon_id = '" $_GET['cid'] . "'");
          
    $new_coupon_active = ($ca_sql->fields['coupon_active'] == 'N') ? '"Y"' '"N"'

    //      $messageStack->add_session('$ca_sql=' . $ca_sql->fields['coupon_active'], 'caution');
    [COLOR="#FF0000"]        $db->Execute("update " TABLE_COUPONS "
                          set coupon_active = 
    $new_coupon_active
                          where coupon_id='"
    .$_GET['cid']."'");
    [/
    COLOR]       $messageStack->add_session(($new_coupon_active == '"N"') ? SUCCESS_COUPON_DISABLED 'Success! Discount Coupon was set to Active ...!''success');
    // replacing
    //        $db->Execute("update " . TABLE_COUPONS . "
    //                      set coupon_active = 'N'
    //                      where coupon_id='".$_GET['cid']."'");
    //        $messageStack->add_session(SUCCESS_COUPON_DISABLED, 'success');
    // replacing
    //jpda: eof toggle coupon_active instead of setting to 'N' always 
    Now the delete button will toggle the status. Need to make some changes to the button texts and add some language defines etc., but it works.
    Questions:
    Is this acceptable?
    Could the code at $ca_sql be done easier?

    On the side, not really related to the subject, the selection character '*' to display all discount coupons does not work, I replaced it by 'A'. The '*' is still present in the ZC1.5.5 version.

    Background:
    A client of mine is using the Autoresponder+ mod, which sends emails to customers, asking them to write a review. The email contains an active discount coupon. Thus, the customer might use the coupon and forget all about the review.
    I change the mod to send an inactive discount coupon, my client needs to be able to reactivate the coupon when the review arrives.

    Thanks in advance,

    jpda
    Last edited by Ajeh; 23 Mar 2016 at 12:47 AM. Reason: typo

 

 

Similar Threads

  1. Replies: 6
    Last Post: 19 Jun 2011, 07:06 AM
  2. Replies: 18
    Last Post: 12 Mar 2010, 06:37 PM
  3. Ideas/Suggestions for Discount Coupon - How to give a credit and a discount
    By vegascoug in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 15 Nov 2007, 05:40 PM
  4. Coupon welcome message showing discount when coupon is expired
    By tracyselena in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 26 Jan 2007, 06:32 PM
  5. Discount Coupon Guide!
    By Camel in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 19 May 2006, 09:46 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