Hello, I somehow managed to do something but it is not enough. I am puting the tracking number for the order on the comments, and I want to be able to search the orders for that tracking number.
What I managet to do so far:
I have made change on this lines in /admin/orders.php
PHP Code:
// 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 have changed it to:
PHP Code:
// 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 . "%' or osh.comments like '" . $keywords . "%')";
$new_table = "left join ".TABLE_ORDERS_STATUS_HISTORY." osh on (osh.orders_id = o.orders_id)";
As well i added osh.comments to all $orders_query_raw = "select osh.comments that has something to do with the TABLE_ORDERS
And now it is possible to perform searh in the order coments but that search has to be exact.
For example if I search for order that have coment xxxxxxxxx122 and I tipe in the serch field xxxxxxxxx12 or anything that differs from xxxxxxxxx122 the search result is empty, how can I make it possible to search for part of the tracking, because I am too lazy to type every time the full number sequence, and i think it is not needed.
Thanks for the help :)
Bookmarks