* @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 7456 $ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class AdminSearch extends AdminTab { /** * Search a specific string in the products and categories * * @params string $query String to find in the catalog */ public function searchCatalog($query) { global $cookie; $this->_list['products'] = Product::searchByName((int)$cookie->id_lang, $query); if (!empty($this->_list['products'])) for ($i = 0; $i < count($this->_list['products']); $i++) $this->_list['products'][$i]['nameh'] = str_ireplace($query, ''.Tools::htmlentitiesUTF8($query).'', $this->_list['products'][$i]['name']); $this->_list['categories'] = Category::searchByName((int)$cookie->id_lang, $query); } /** * Search a specific name in the customers * * @params string $query String to find in the catalog */ public function searchCustomer($query) { $this->_list['customers'] = Customer::searchByName($query); } function postProcess() { global $cookie; $query = trim(Tools::getValue('bo_query')); $searchType = (int)Tools::getValue('bo_search_type'); /* Handle empty search field */ if (empty($query)) $this->_errors[] = Tools::displayError('Please fill in search form first.'); else { echo '
'.($i == 0 ? htmlentities($key, ENT_COMPAT, 'utf-8') : ' ').' | '.htmlentities(stripslashes($tab[$i]['value']), ENT_COMPAT, 'utf-8').' |
---|
'.rtrim(getPath($currentIndex.'?tab=AdminCatalog', $category['id_category'], '', $query), ' >').' |
'.$field['title'].' | '; echo '|||||||||
---|---|---|---|---|---|---|---|---|---|
'.$product['id_product'].' | '.($product['manufacturer_name'] != NULL ? stripslashes($product['manufacturer_name']) : '--').' | '.$product['reference'].' | '.stripslashes($product['nameh']).' | '.Tools::displayPrice($product['price'], $currency).' | '.stripslashes($product['tax_name']).' | '.$product['quantity'].' | '.$product['weight'].' '.Configuration::get('PS_WEIGHT_UNIT').' |