
Originally Posted by
mysh
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%'
Bookmarks