megiddo wrote:The problem is not in the categories box, it is in the Search category drop-down in header.tpl. One solution is to reimplement using an Ajax drop-down (Category/Category/Category/...), but for simplicity, I have included the following. You must also nix the category dropdown on search.tpl.
A different solution is to render these drop downs statically (which gets regenerated at category update time), and dump them that way.
This is my workaround:
This is a real workaround!
Why the OC-team has built it in the way it originally works is quite obvious if we think that many shopusers use the search. In fact, I think that most shop users do'nt search by other means than browsing. The original method makes the OC eat heavily on the servers load. Megiddo has a point here, and maybe the OC should be built a little different?
It could quite easily generate a static file that gets picked up (or even directly included) where the category dropdown is placed. In this way the list of categories is placed rather than rendered on every page viewed, saving server and database load.
The file could be generated every time a category is changed (should'nt be to hard to make this, eh?)
Allso: the usage of this file shuld be an add-on; without it all products are scanned in the searc, with it the search is only in the active category.
Anyway: Thanks to Megiddo for actually identifying the problem area and supplying a good and easy workaround.
falkweb