Opencart在搜索页面中显示所有产品(Opencart show all products in search page)
在opencart 2.1.0.2中,我试图在搜索页面中显示所有产品而不是配置限制。
在目录/ controller / product / search.php中
在375行中有以下代码:
$data['limits'] = array(); $limits = array_unique(array($this->config->get('config_product_limit'), 25, 50, 100)); sort($limits); foreach($limits as $value) { $data['limits'][] = array( 'text' => $value, 'value' => $value, 'href' => $this->url->link('product/search', $url . '&limit=' . $value) ); }
另外在62行左右有:
if (isset($this->request->get['limit'])) { $limit = (int)$this->request->get['limit']; } else { $limit = $this->config->get('config_product_limit'); }
我试着设定
$limit = 9999;
也要更换
25, 50, 100 with 9999
但没有运气。
我想要完成的是在opencart 2的搜索结果页面中获取所有产品(= 9999)以删除分页,但也保持每页的其他页面产品限制。
有任何想法吗? 指针?
谢谢!
In opencart 2.1.0.2, I am trying to display in search page all products instead of the configuration limit.
In catalog/controller/product/search.php
there is the following code in 375 line:
$data['limits'] = array(); $limits = array_unique(array($this->config->get('config_product_limit'), 25, 50, 100)); sort($limits); foreach($limits as $value) { $data['limits'][] = array( 'text' => $value, 'value' => $value, 'href' => $this->url->link('product/search', $url . '&limit=' . $value) ); }
Also in around 62 line there is:
if (isset($this->request->get['limit'])) { $limit = (int)$this->request->get['limit']; } else { $limit = $this->config->get('config_product_limit'); }
I tried to set
$limit = 9999;
Also to replace
25, 50, 100 with 9999
but no luck.
What I am trying to accomplish is in the search result page of opencart 2 to get all products (=9999) in order to remove pagination but also keep the other pages product limit per page.
Any ideas? pointers?
thank you!
原文:https://stackoverflow.com/questions/44271337
最满意答案
使用最新的
lein-ring
插件版本0.9.2并将包含:nrepl-middleware
矢量的nrepl-middleware添加到:repl-options
project.clj中的:repl-options
例如,我通过
lein new compojure-app my-app
创建项目。 然后,我通过在~/.lein/profiles.clj
ex中创建一个空的leiningen配置文件来测试它。{:yolo {}}
和lein with-profile yolo,dev ring server
。(defproject my-app "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :dependencies [[org.clojure/clojure "1.6.0"] [compojure "1.1.6"] [hiccup "1.0.5"] [ring-server "0.3.1"] [cider/cider-nrepl "0.8.2"]] :plugins [[lein-ring "0.9.2"]] :ring {:handler my-app.handler/app :init my-app.handler/init :destroy my-app.handler/destroy :nrepl {:start? true}} :repl-options {:nrepl-middleware [cider.nrepl.middleware.apropos/wrap-apropos cider.nrepl.middleware.classpath/wrap-classpath cider.nrepl.middleware.complete/wrap-complete cider.nrepl.middleware.info/wrap-info cider.nrepl.middleware.inspect/wrap-inspect cider.nrepl.middleware.macroexpand/wrap-macroexpand cider.nrepl.middleware.ns/wrap-ns cider.nrepl.middleware.resource/wrap-resource cider.nrepl.middleware.stacktrace/wrap-stacktrace cider.nrepl.middleware.test/wrap-test cider.nrepl.middleware.trace/wrap-trace cider.nrepl.middleware.undef/wrap-undef]} :profiles {:uberjar {:aot :all} :production {:ring {:open-browser? false, :stacktraces? false, :auto-reload? false}} :dev {:dependencies [[ring-mock "0.1.5"] [ring/ring-devel "1.3.1"]]}})
Use latest
lein-ring
plugin version 0.9.2 and add:nrepl-middleware
containing vector of nrepl-middlewares to:repl-options
in your project.cljFor example, I create the project by
lein new compojure-app my-app
. Then, I tested it by creating a empty leiningen profile in~/.lein/profiles.clj
ex.{:yolo {}}
and starting ring server bylein with-profile yolo,dev ring server
.(defproject my-app "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME" :dependencies [[org.clojure/clojure "1.6.0"] [compojure "1.1.6"] [hiccup "1.0.5"] [ring-server "0.3.1"] [cider/cider-nrepl "0.8.2"]] :plugins [[lein-ring "0.9.2"]] :ring {:handler my-app.handler/app :init my-app.handler/init :destroy my-app.handler/destroy :nrepl {:start? true}} :repl-options {:nrepl-middleware [cider.nrepl.middleware.apropos/wrap-apropos cider.nrepl.middleware.classpath/wrap-classpath cider.nrepl.middleware.complete/wrap-complete cider.nrepl.middleware.info/wrap-info cider.nrepl.middleware.inspect/wrap-inspect cider.nrepl.middleware.macroexpand/wrap-macroexpand cider.nrepl.middleware.ns/wrap-ns cider.nrepl.middleware.resource/wrap-resource cider.nrepl.middleware.stacktrace/wrap-stacktrace cider.nrepl.middleware.test/wrap-test cider.nrepl.middleware.trace/wrap-trace cider.nrepl.middleware.undef/wrap-undef]} :profiles {:uberjar {:aot :all} :production {:ring {:open-browser? false, :stacktraces? false, :auto-reload? false}} :dev {:dependencies [[ring-mock "0.1.5"] [ring/ring-devel "1.3.1"]]}})
相关问答
更多-
Vim Clojure Cider Fireplace连接需要指定端口(Vim Clojure Cider Fireplace connect requires specifying port)[2021-10-19]
就在这里。 通常,当您启动lein repl ,leiningen会在项目目录的根目录中创建一个名为.nrepl-port的文件,其内容应该只是作为整数的开放端口。 您也可以手动创建此文件并填写,但请注意,当您运行lein repl时,Leiningen将使用nREPL服务器正在侦听的任何端口覆盖此文件。 Yes, there is. Normally, when you start lein repl, leiningen creates a file called .nrepl-port in the ... -
无法在Macintosh系统上使用emacs + ritz-nrepl(Can't get emacs + ritz-nrepl working on a Macintosh system)[2022-04-12]
你安装了最新版本的nrepl-ritz.el吗? 您的案例似乎与https://github.com/pallet/ritz/issues/53中讨论的问题相同。 Fact: lein ritz-nrepl had returned an error. In a moment of fuzzy-thinking intuition, it occurred to me that this might mean that the underlying problem had to do with Java, ... -
我刚刚遇到这个问题,我通过添加一个显式依赖于更新的tools.nrepl到profiles.clj来解决它。 我的~/.lein/profiles.clj : {:repl {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]] :dependencies [[org.clojure/tools.nrepl "0.2.7"]]}} 不知道这是最好的还是官方的方法吗 I've just had this problem, and I solved i ...
-
如何使用苹果酒的叠加层(How to use Cider's overlay)[2024-01-02]
cider-use-overlays是一个变量,而不是一个函数 - 你不能运行变量。 苹果酒中有很多东西都在使用叠加层。 默认情况下启用此特定变量并控制结果的显示(它们传统上显示在迷你缓冲区中)。 还有enligten-mode ,这也受到了LT的启发。 cider-use-overlays is a variable, not a function - you can't run a variable. There are many things in cider which are using over ... -
根据文件 , clojure:nrepl目标要求org.clojure / tools.nrepl作为项目依赖项 尝试将嵌套在插件中的依赖项移至您声明对Clojure依赖的位置。 示例POM:
与nrepl的lein ring服务器不尊重cider-nrepl(lein ring server with nrepl doesn't honour cider-nrepl)[2022-12-29]
使用最新的lein-ring插件版本0.9.2并将包含:nrepl-middleware矢量的nrepl-middleware添加到:repl-options project.clj中的:repl-options 例如,我通过lein new compojure-app my-app创建项目。 然后,我通过在~/.lein/profiles.clj ex中创建一个空的leiningen配置文件来测试它。 {:yolo {}}和lein with-profile yolo,dev ring server 。 ...连接到具有ring / compojure的clojure nREPL的问题(Problems connecting to a clojure nREPL with ring/compojure)[2023-09-23]
这不是一个直接的答案,但我发现我并没有以正确的方式解决这个问题。 Luminus创建了一个project-name.repl命名空间,该命名空间应该用于交互式开发。 我发现通过添加到project.clj ,我可以做我想做的事 :repl-options { :init-ns project-name.repl :init (start-server)} 然后只需使用lein repl启动服务器。 比设置nREPL中间件简单得多! N ...如何使用Emacs / nrepl / Quil在Clojure中实现代码?(How do I live code in Clojure using Emacs / nrepl / Quil?)[2021-07-28]
在要缓存的函数中尝试CMx (这会破坏当前的顶级表单)或者在源缓冲区中使用Cc Ck (这会破坏当前缓冲区)。 顺便说一句, Cx Ce也应该工作(它肯定适合我,但我很少使用它)。 也许你没有使用nrepl.el的最新版本? Try C-M-x (this evals the current top-level form) in the function you want to change or C-c C-k (this evals the current buffer) in the source b ...在emacs中评估* nrepl *缓冲区中的Clojure命名空间(Evaluate Clojure namespace in *nrepl* buffer in emacs)[2023-07-02]
类型Cc Mn: https://github.com/clojure-emacs/nrepl.el 将repl缓冲区的命名空间切换到当前缓冲区的命名空间。 Type C-c M-n: https://github.com/clojure-emacs/nrepl.el Switch the namespace of the repl buffer to the namespace of the current buffer.nrepl的jack-in行为取决于在调用jack-in命令时支持缓冲区的文件的位置。 要获得一个vanilla no-project repl,请确保从没有Clojure项目的缓冲区运行nrepl-jack-in 。 要通过插件在特定项目中运行repl,请在访问该项目顶级文件时运行它( project.clj是一个主要的cantidate)。 nrepl's jack-in behavior is dependent on the location of the file backing the buff ...相关文章
更多- Faceted search
- 使用Hibernate+solr取代hibernate search
- Spring 与 Hibernate-Search 整合后 保存失败
- Realtime Search: Solr vs Elasticsearch
- Full-Text Search in ASP.NET using Lucene.NET
- Stack Overflow Architecture Update - Now At 95 Million Page Views A Month
- Open Source Search Engines in Java
- Solr: a custom Search RequestHandler
- Custom SOLR Search Components - 2 Dev Tricks
- ElasticSearch入门-Bulk,Search操作
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)