Just in case anyone need it, i Post it here, this is useful to add any order search criteria to your cart.
in app/addons/my_changes/func.php add your search criteria lines, in my case s_firstname and s_lastname
if (!defined('BOOTSTRAP')) { die('Access denied'); }
function fn_my_changes_create_orders_condition_pre(&$params, $lang_code){
if (!empty($params['q'])) {
$params['postcode'] = $params['q'];
// if you would like to add customer's 'company' name to the search query uncomment line below:
$params['email2'] = $params['q'];
$params['s_firstname'] = $params['q'];
$params['s_lastname'] = $params['q'];
}
}
function fn_my_changes_get_orders($params, $fields, $sortings, &$condition, $join, $group){
if (!empty($params['postcode'])) {
$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'])."%");
}
// if you would like to add customer's 'company' name to the search query uncomment lines below:
if (!empty($params['pnotes'])) {
$condition .= db_quote(" " . (isset($params["compact"]) ? "OR" : "AND") . " (?:orders.pnotes LIKE ?l)", "%".trim($params['pnotes'])."%");
}
// if you would like to add customer's 'company' name to the search query uncomment lines below:
if (!empty($params['s_firstname'])) {
$condition .= db_quote(" " . (isset($params["compact"]) ? "OR" : "AND") . " (?:orders.s_firstname LIKE ?l)", "%".trim($params['s_firstname'])."%");
}
// if you would like to add customer's 'company' name to the search query uncomment lines below:
if (!empty($params['s_lastname'])) {
$condition .= db_quote(" " . (isset($params["compact"]) ? "OR" : "AND") . " (?:orders.s_lastname LIKE ?l)", "%".trim($params['s_lastname'])."%");
}
Add the search criteria in app/addons/my_changes/schemas/search/sechema.post.php
and to finish, if you want to have the search in sidebar orders panel, add the fields on the template