Contributions
Search Orders by Customer Info
In original osC orders can be "searched" by their ID's only. This very simple mod makes it possible to search and list orders in admin/orders.php according to customer's name or company. If order id is used as a search term, that order is then shown in more detail (which is the original behaviour).
Expand All / Collapse All
Step 2 is completely opaque to those of us without the coding experience (as is the correction to Step 2 as posted by Danuel.)
Anybody like to take a shot at clarifying this for us? Please?
Attached is a text file with below info. For those who have added mods to their admin/orders.php, the sql update should go after "else", which is on line 361 in original osC 2.2. See below ( ... = some omitted code):
<?php
if (isset($HTTP_GET_VARS['cID'])) { ...
$orders_query_raw = "select ... ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) { ...
$orders_query_raw = "select ... 'ot_total' order by o.orders_id DESC";
} else { ...
$orders_query_raw = "select ... 'ot_total' " . (!is_null($search_query)?$search_query:''). " order by o.orders_id DESC";
}
changed is_integer() to preg_match()
CHANGELOG:
v. 1.1. by jashnu
1. Changed search query's ANDs to ORs so multiple names/companies can be searched at once.
2. Added sql-sentence modification to elseif as well.
3. Added javascript to clear input field automatically.
In original osC orders can be "searched" by their ID's only. This very simple mod makes it possible to search and list orders in admin/orders.php according to customer's name or company. If order id is used as a search term, that order is then shown in more detail (which is the original behaviour).
Note: Contributions are used at own risk.