Hello!

Briefly about the essence of the task: the standard theme is set in opencart, it turns out that the categories (collections) of goods and the list of single goods are displayed on one page, you need to make a switch, i.e. clicked on the button shows only the collection of goods, clicked on another button - the goods appeared.

Problem: in order to differentiate the output of goods and collections, you need to find the controller file that outputs them, which I can’t cope with for three days, I read on the Internet that the catalog / controller / product / category file is responsible for the output of goods and collections .php - output product group, then I tried to edit it, but nothing happened, even if I erase all the code in that file, nothing changes, about 550 lines of code in php in it, i.e. Site behavior when category.php is empty and when there are 550 lines of code in it is no different, which is very strange to me. But, suddenly, if this file is deleted altogether and not just the text in it, then the goods and collections immediately disappear, and instead of them a message appears stating that the requested page was not found, as a joke. So this file and the code in it for some reason needed.

Help please, I don’t even know what to do.

  • Additional modules installed? For example, filter modules, caching? - Dmitry B.
  • Yes, and where does the controller? If the show / hide button can be implemented in the category.tpl output template file using javascript. - Dmitry B.
  • By "collection of goods" do you mean a list of subcategories? - Dmitry B.
  • Yes, of the additional modules I installed mega filter pro, under the collection of products, I mean the group of products that have common features, in opnecart they are located above the goods. Yes, I thought about these, but is there any point in doing such a mediocre implementation through js, i.e. every time the filter changes, ajax sends both categories and products, and you have to delete one of the html, is it much more convenient and better for me to do this through the controller, or am I wrong? - Shillkas

1 answer 1

Why editing source catalog/controller/product/category.php does not help :

Because You use vqMod / ocMod extensions , such as filter pro , the original files are modified and cached. And then they are already read from the system/storage/madification/ for the ocMod, and coren_sayta/vqmod/vqcache для расширений vqmod . Now, each time making changes to the source (the same catalog/controller/product/category.php ), you need to clear the cache and update the layout. This is done either by hand, deleting folders / files from the above storages, or in the admin in the menu Менеджер дополнений/Modifications

Editing the presentation of the template is more logical in the files of the presentation (template) :). Those. do all sorts of switches not in the controller, but in vash_domen\catalog\view\theme\default(vash_shablon)\template\product\category.tpl

ZY Before rendering, if you do not clear the caches, the system checks only the availability of the source code. From that and "not found" if you delete the file.

ZYY.Y. All the files for some reason, yes need =)

  • Thanks for the informative answer (not sarcasm). - Shillkas
  • Tell me, did I understand correctly, you need to delete all files in the system / storage / madification / folder, now there is such a structure joxi.ru/DrlzjbDU4Kkdw2 ? In the coren_sayta / vqmod / vqcache joxi.ru/a2XWvKgIyQKZ1m folder , what is there? - Shillkas
  • in general, yes. The ocMod screen shows the structure of files that have been modified by extensions. This structure is identical to the structure of your site. Those. Names / order / nesting of folders is the same. And with vqMod you have to be careful. In the name of any cache file vqMod there is a link to the original file, after vq2-. Those. if in doubt, hit only the files, in the names of the short ones the namespace of the original file (vq2-catalog_view ...). HO !!! Start by clearing the admin cache, I described how. And if it does not help, do it with your hands. And in front of my hands, I would also drop the cache on the host. - Kirill Korushkin
  • Regarding clearing the cache from the admin, after I clicked on the edit button opposite the modification manager joxi.ru/4Akzj8DUMjBbp2 , this appeared joxi.ru/v29OVXzSG4kXqr , there are about 1000 lines of code in php js html (xml), all this needs to be erased ? - Shillkas
  • not. on the screenshot is the admin extension, I don't know it. I did not write about it but about it: imgur.com/a/zRmNV - Kirill Korushkin