Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2011
    Posts
    54
    Plugin Contributions
    0

    Default Viewing coupon stats

    I was wondering if there was anywhere coupon uses was stored.

    I accidently let a popular coupon expire last week and I just noticed it today. I am kicking myself and I wanted to see how times it was attempted in the past week. Is there anywhere this info is stored that I can view?

  2. #2
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Viewing coupon stats

    Quote Originally Posted by mysh View Post
    I was wondering if there was anywhere coupon uses was stored.

    I accidently let a popular coupon expire last week and I just noticed it today. I am kicking myself and I wanted to see how times it was attempted in the past week. Is there anywhere this info is stored that I can view?
    In the Zen Cart admin (1.5.x), under "Gift Certificate/Coupons" -> "Coupon Admin" one can select a coupon by name / code and then click "Report" on the right side of the screen to get an overall report of the coupon's use.

    One can also retrieve the number of uses by running a SQL Query against the database if needed. In the following examples make sure to add your database "prefix" to table names if you configured a database "prefix". Also replace "your_coupon_code" with the code of the actual coupon you are looking for statistics upon. If one needs to filter by date, that can also be done by altering the example SQL queries to check against the redeem date or order data.

    If the coupon was not manually deleted:
    Code:
    SELECT COUNT( `crt`.`unique_id` ) AS `uses`
    FROM `coupons` AS `c`
    LEFT JOIN `coupon_redeem_track` AS `crt` ON `c`.`coupon_id` = `crt`.`coupon_id`
    WHERE `c`.`coupon_code` = 'your_coupon_code'
    Alternatively by scanning the order_total table:
    Code:
    SELECT COUNT( `orders_id` ) AS `uses`
    FROM `orders_total`
    WHERE `class` = 'ot_coupon'
    AND `title` LIKE '%your_coupon_code%'
    Last edited by lhungil; 26 Dec 2013 at 05:24 PM.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  3. #3
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Viewing coupon stats

    To check against the dates (using coupon_redeem_track), just add something like:
    Code:
    SELECT COUNT( `crt`.`unique_id` ) AS `uses`
    FROM `coupons` AS `c`
    LEFT JOIN `coupon_redeem_track` AS `crt` ON `c`.`coupon_id` = `crt`.`coupon_id`
    WHERE `c`.`coupon_code` = 'your_coupon_code' AND `crt`.`redeem_date` >= '2013-12-18'
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

 

 

Similar Threads

  1. coupon for Team, excluding order from sales stats
    By youniquephotos in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 2
    Last Post: 17 Sep 2007, 05:57 PM
  2. Sales-n-Stats
    By simon-m in forum General Questions
    Replies: 1
    Last Post: 30 May 2006, 05:57 AM

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