Друзья, есть вот такой поиск: Код: <?phpclass ControllerSearchAutocomplete extends Controller { public function index() { $json = array();if (isset($this->request->get['filter_name'])) { $this->load->model('catalog/product');$this->load->model('tool/image');if (isset($this->request->get['filter_name'])) { $filter_name = $this->request->get['filter_name'];} else { $filter_name = '';} $data = array( 'filter_name' => $filter_name,'start' => 0,'limit' => 5);$results = $this->model_catalog_product->getProducts($data);foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'],100, 100);} else { $image = false;} if ($this->config->get('config_review_status')) { $rating = $result['rating'];} else { $rating = false;} if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));} else { $price = false;} if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));} else { $special = false;} $json[] = array( 'product_id' => $result['product_id'],'thumb' => $image,'name' => strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')),'desc' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 45) . '..','price' => $price,'href' => html_entity_decode($this->url->link('product/product', 'product_id=' . $result['product_id']), ENT_QUOTES, 'UTF-8'),);} } $this->response->setOutput(json_encode($json));} } ?> Подскажите, как дополнить $json[] = array что была выборка и с опций продукта. Заранее большое спасибо.
посмотри модуль Search suggestion - поиск с автодополнением (https://opencartforum.com/files/file/516-search-suggestion-поиск-с-автодополнением/) может подойдет для решение этого вопроса
Просто изменением запроса этот вопрос не решить, так как метод model_catalog_product->getProducts умеет фильтровать только по имени и тегам. Если добавите в запросе 'filter_description' => true, то будет искать еще и в описании товара.