PDA

View Full Version : Credit Class & Gift Voucher



michael_s
12-12-2007, 03:21 AM
There is a bug in the coupon report in the coupon admin section. This is where you can select a coupon and then click "Report". The bug is that the admin section says there have been X redemption and then you click into report and it says there are Y redemptions.

To fix, edit /admin/coupon_admin.php

around line 226 where:

$cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . (int)$coupon_id . "'";
$cc_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);
$cc_query = tep_db_query($cc_query_raw);

change to:

$cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . (int)$coupon_id . "'";
$cc_query = tep_db_query($cc_query_raw);
$cc_query_numrows = tep_db_num_rows($cc_query);
$cc_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);

the splitPageResults function wasen't receiving anything for $cc_query_numrows.

More... (http://addons.oscommerce.com/info/282)