By default when using search in cs-cart admin you can search for orders by order_id, email and cname (customer name).
We needed to add ability to search by post code (zip code) as well.
Here is what you need to do to achieve this:
add hooks to:
app/addons/my_changes/init.php
<br />
<?php<br />
if (!defined('BOOTSTRAP')) { die('Access denied'); }<br />
<br />
fn_register_hooks(<br />
'get_orders',<br />
'create_pages_condition_pre'<br />
);<br />
```<br />
<br />
add functions to:<br />
[b]app/addons/my_changes/func.php[/b]<br />
```php
<br />
<?php<br />
if (!defined('BOOTSTRAP')) { die('Access denied'); }<br />
<br />
function fn_my_changes_create_pages_condition_pre(&$params, $lang_code){<br />
if (!empty($params['q'])) {<br />
$params['postcode'] = $params['q'];<br />
// if you would like to add customer's 'company' name to the search query uncomment line below:<br />
//$params['company'] = $params['q'];<br />
}<br />
}<br />
<br />
function fn_my_changes_get_orders($params, $fields, $sortings, &$condition, $join, $group){ <br />
<br />
if (!empty($params['postcode'])) {<br />
$condition .= db_quote(" " . (isset($params["compact"]) ? "OR" : "AND") . " (0 OR (?:orders.s_zipcode LIKE ?l OR ?:orders.b_zipcode LIKE ?l))", "%".trim($params['postcode'])."%", "%".trim($params['postcode'])."%");<br />
}<br />
// if you would like to add customer's 'company' name to the search query uncomment lines below:<br />
<br />
// if (!empty($params['company'])) {<br />
// $condition .= db_quote(" " . (isset($params["compact"]) ? "OR" : "AND") . " (?:orders.company LIKE ?l)", "%".trim($params['company'])."%");<br />
// }<br />
<br />
}<br />
```<br />
<br />
modify search schema:<br />
[b]app/addons/my_changes/schemas/search/schema.post.php[/b]<br />
```php
<br />
<?php<br />
if (AREA == 'A') {<br />
$scheme['orders']['action_link'] .= '&postcode=%search%';<br />
// if you would like to add customer's 'company' to the search query uncomment line below:<br />
// $scheme['orders']['action_link'] .= '&company=%search%';<br />
}<br />
return $scheme;<br />
```<br />
<br />
And that should be it!<br />
Now you can type part or full postcode (zipcode) into main search and it should find all orders with given postcode in billing or shipping address.<br />
<br />
I hope this helps someone.<br />
<br />