Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Location
    Portland, OR
    Posts
    2
    Plugin Contributions
    0

    Default How do I control the display order in Coupon Admin

    I've tried to sort the coupons table in phpMyAdmin to make finding a coupon code in ZenCart Coupon Admin easier. This sort kind of works but is not completely successful. There seems to be other forces at work the cause the displayed list to show not in pure Coupon Code order.

    I looks like dollar discounts are shown first, then percent discounts.

    What can I change to always show the list in Coupon Code order?

    -Thanks, Alan

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How do I control the display order in Coupon Admin

    Look around line 994 and you will see the code where the SELECTs are made ...

    In this example, the sort order has been set to sort by the Start date of the coupons:
    Code:
        if ($status != '*') {
          $cc_query_raw = "select coupon_id, coupon_code, coupon_amount, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified, coupon_active, coupon_zone_restriction from " . TABLE_COUPONS ." where coupon_active='" . zen_db_input($status) . "' and coupon_type != 'G'" . " order by coupon_start_date";
        } else {
          $cc_query_raw = "select coupon_id, coupon_code, coupon_amount, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified, coupon_active, coupon_zone_restriction from " . TABLE_COUPONS . " where coupon_type != 'G'" . " order by coupon_start_date";
        }
    you can try the field:
    coupon_code

    instead of the field:
    coupon_start_date
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. How to display shipping weight in admin order detail page?
    By penner in forum Managing Customers and Orders
    Replies: 1
    Last Post: 6 Apr 2011, 12:27 AM
  2. can you control the sort order of the featured products on the front page
    By George Susini in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Apr 2009, 08:05 PM
  3. How can I display the product image in the placed order?
    By jarcher in forum Managing Customers and Orders
    Replies: 2
    Last Post: 8 Dec 2008, 03:15 PM
  4. How to control the display of the shopping cart sidebox
    By ajhb in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Aug 2008, 05:45 AM
  5. How to display more Order's info. in Admin.?
    By Stenrique in forum General Questions
    Replies: 1
    Last Post: 3 Jul 2008, 08:56 PM

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