Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2013
    Location
    MTL
    Posts
    66
    Plugin Contributions
    2

    Default Priority Handling Search

    Hi Everyone,

    I am working on developing a seach function in Orders Module of ZC 1.51 to be able to filter priority handling orders and process them prior to regular orders. So, I downloaded and install the Priority Handling module and it works great. Saddly, there is no search/filter function to help agents sidentify and process those orders at a glance.

    So I started building my own and for now parts of the code will be hard coded. Any help is greatly appreciated.

    What I would like to do is create a drop down list as a search list and then be able to filter futher by order status. Similar to search by product or customer info.

    The code below allows me to have a drop down list but I can only use it as a filter status/priority. I need to compound that search instead of one or the other
    ...........................
    // prepare order-priority pulldown list
    $priority = array($priority_array);
    $priority_array = array();
    ..................
    <tr><?php echo zen_draw_form('priority', FILENAME_ORDERS, '', 'get', '', true); ?>
    <td class="smallText" align="right">
    <?php
    echo PRIORITY . ' ' . zen_draw_pull_down_menu('priority', array_merge(array(array('id' => 'ot_priority_handling', 'text' => 'Priority

    Handling')), $priority), $_GET['priority'], 'onChange="this.form.submit();"');
    echo zen_hide_session_id();
    ?>
    </td>
    </form></tr>
    ..............................
    Code that needs to be worked on or changed is below but works as a filter now
    ..............................

    //echo '<BR><BR>I SEE ABC: ' . $orders_query_raw . '<BR><BR>';

    } elseif ($_GET['priority'] != '') {
    $priority = zen_db_prepare_input($_GET['priority']);
    $orders_query_raw = "select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified,

    o.currency, o.currency_value, s.orders_status_name, ot.class, ot.title, ot.text as order_total" .
    $new_fields . "
    from (" . TABLE_ORDERS_STATUS . " s, " .
    TABLE_ORDERS . " o " .
    $new_table . ")
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id ) " . "
    where ot.class like 'ot_priority_handling' and o.orders_status = s.orders_status_id" .
    $search . " order by o.orders_id DESC";

  2. #2
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Priority Handling Search

    If you are looking to build a search...
    admin/orders.php

    Zen already has one started...
    <?php
    // Only one or the other search
    // create search_orders_products filter
    $search = '';
    $new_table = '';
    $new_fields = '';
    if (isset($_GET['search_orders_products']) && zen_not_null($_GET['search_orders_products'])) {
    $new_fields = '';
    $search_distinct = ' distinct ';
    $new_table = " left join " . TABLE_ORDERS_PRODUCTS . " op on (op.orders_id = o.orders_id) ";
    $keywords = zen_db_input(zen_db_prepare_input($_GET['search_orders_products']));
    $search = " and (op.products_model like '%" . $keywords . "%' or op.products_name like '" . $keywords . "%')";
    if (substr(strtoupper($_GET['search_orders_products']), 0, 3) == 'ID:') {
    $keywords = TRIM(substr($_GET['search_orders_products'], 3));
    $search = " and op.products_id ='" . (int)$keywords . "'";
    }
    } else {
    ?>
    <?php
    // create search filter
    $search = '';
    if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
    $search_distinct = ' ';
    $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
    $search = " and (o.customers_city like '%" . $keywords . "%' or o.customers_postcode like '%" . $keywords . "%' or o.date_purchased like '%" . $keywords . "%' or o.billing_name like '%" . $keywords . "%' or o.billing_company like '%" . $keywords . "%' or o.billing_street_address like '%" . $keywords . "%' or o.delivery_city like '%" . $keywords . "%' or o.delivery_postcode like '%" . $keywords . "%' or o.delivery_name like '%" . $keywords . "%' or o.delivery_company like '%" . $keywords . "%' or o.delivery_street_address like '%" . $keywords . "%' or o.billing_city like '%" . $keywords . "%' or o.billing_postcode like '%" . $keywords . "%' or o.customers_email_address like '%" . $keywords . "%' or o.customers_name like '%" . $keywords . "%' or o.customers_company like '%" . $keywords . "%' or o.customers_street_address like '%" . $keywords . "%' or o.customers_telephone like '%" . $keywords . "%' or o.ip_address like '%" . $keywords . "%')";
    $new_table = '';

    I'm certain you can modify it to work with the particular fields you'd like to search for.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

 

 

Similar Threads

  1. Rush/Priority Handling Charge
    By mlankeit in forum Managing Customers and Orders
    Replies: 53
    Last Post: 16 Oct 2018, 07:58 PM
  2. Handling Fee for Armed Forces USPS Priority
    By mafiasam in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 7 Dec 2010, 02:13 AM
  3. Rush Priority Handling Tax Calculation Issue
    By catteridge in forum Managing Customers and Orders
    Replies: 0
    Last Post: 9 Dec 2009, 09:00 PM
  4. Replies: 1
    Last Post: 19 Nov 2009, 10:36 PM
  5. Disable Priority Handling addon Module?
    By stride-r in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 21 Apr 2009, 03:59 PM

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