Php 在Opencart的搜索结果页面中显示筛选选项
我正在使用OpencartPhp 在Opencart的搜索结果页面中显示筛选选项,php,search,filter,opencart,categories,Php,Search,Filter,Opencart,Categories,我正在使用Opencart2.0.3.1版。 我想在搜索结果页面中显示过滤器。但是筛选选项未显示在搜索结果页面 但是在分类页面中,我可以显示过滤器 我该怎么做?请帮助我…您不能在搜索页面中显示筛选模块。因为筛选需要类别数据,并且使用该类别数据它可以正常工作。在搜索页面中,可能有来自不同类别的产品。所以在搜索页面上没有显示过滤器的选项。但是,如果您仍然想这样做,就不要构建自己的代码 编辑 签入模块/filter.php控制器:- if (isset($this->request-&g
2.0.3.1版。
我想在搜索结果页面
中显示过滤器
。但是筛选选项
未显示在搜索结果页面
但是在分类页面
中,我可以显示过滤器
我该怎么做?请帮助我…您不能在搜索页面中显示筛选模块。因为筛选需要类别数据,并且使用该类别数据它可以正常工作。在搜索页面中,可能有来自不同类别的产品。所以在搜索页面上没有显示过滤器的选项。但是,如果您仍然想这样做,就不要构建自己的代码 编辑 签入模块/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);
}
}