Results 1 to 1 of 1
  1. #1

    Idea or Suggestion Searching coupons

    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">&nbsp;<?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'] : '')); ?>&nbsp;</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.
    Attached Files Attached Files

 

 

Similar Threads

  1. v139h Searching
    By adb34 in forum General Questions
    Replies: 1
    Last Post: 20 Oct 2012, 01:14 PM
  2. searching searching for this link
    By alwinch in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Oct 2008, 06:41 PM
  3. Catalog searching
    By cdelab in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 16 Aug 2008, 10:15 PM
  4. Searching IP addresses
    By gabenn2 in forum Managing Customers and Orders
    Replies: 1
    Last Post: 30 Aug 2007, 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