Hi.
This is a simple change on coupon_admin.php file to allow search coupons (on my site i have more than 1000)
:)
First add the form on line 989 between </td> and <td> lines
Code:
<td class="main"><?php echo zen_draw_form('search_coupon', FILENAME_COUPON_ADMIN, '', 'get', '', true); ?>
<?php
// toggle switch for editor
echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id();
if (isset($_GET['search']) && zen_not_null($_GET['search']))
$keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
// echo zen_hide_session_id() .
echo zen_draw_hidden_field('action', 'search_coupon') .
'</form>';
?>
</td>
Then add on line 1042 add the search to query:
Code:
$keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
if (isset($_GET['search']) && zen_not_null($_GET['search']))
$search = " and coupon_code like '%" . $keywords . "%'";
And in line 1093 add to the pagination links (change the actual line):
Code:
<td align="right" class="smallText"> <?php echo $cc_split->display_links($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], (isset($_GET['status']) ? '&status=' . $_GET['status'] : '').(isset($_GET['search']) ? '&search=' . $_GET['search'] : '')); ?> </td>
This way now there is a search coupons textbox on admin page and you can look for coupons.
:)
The changed file is attached here too.
Byron H.
Bookmarks