我使用的是Opencart Version 2.0.3.1.
我想在Search result page
中显示filter
。但filter option
不显示在search result page
中。
但是在category page
中我可以显示filter
.
我该怎么做?
不能在搜索页面显示过滤模块。过滤器需要类别数据,并使用该类别数据。在搜索页面上可能会有来自不同类别的产品。所以在搜索页面上没有显示过滤器的选项。但是如果你仍然想这样做,那就构建你自己的代码吧。
编辑
检查module/filter.php控制器:-
if (isset($this->request->get['path'])) {
$parts = explode('_', (string)$this->request->get['path']);
} else {
$parts = array();
}
$category_id = end($parts);
$this->load->model('catalog/category');
$category_info = $this->model_catalog_category->getCategory($category_id);
if ($category_info) {
........
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/filter.tpl')) {
return $this->load->view($this->config->get('config_template') . '/template/module/filter.tpl', $data);
} else {
return $this->load->view('default/template/module/filter.tpl', $data);
}
}