dongnai8013 2017-07-24 11:25
浏览 32
已采纳

当搜索为空或空白时显示所有产品Opencart 2.3.x.

I recently started using OpenCart. When I use the search option on OpenCart with an empty or blank keyword it searches for "" which yields 0 results.

Is it possible to get all products on the site when user types an empty or blank search keyword?

  • 写回答

1条回答 默认 最新

  • douzhang1955 2017-07-25 12:08
    关注

    You need to check the file catalog/controller/product/search.php and check the condition in index() function

    if ($this->request->get['search'] == '') 
    

    For above condition's true block, you can remove 'filter_name' index from $filter_data array and you can reuse the code needed to get products.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3