R
R
rapman4772020-09-18 17:59:24
Twig
rapman477, 2020-09-18 17:59:24

What is the mechanics of modifiers in OpenCart 3?

It was necessary to display only one product card on the main page. This task was completed using the built-in module - "Recommended".
It was also necessary to display Options for the product - they are not displayed in the "Recommended" module. I "sawed out" the part of the code I needed with options from the controller and the template of the "product" page and sewed it into the "Recommended" module. The options are now displayed.
The last thing I need to do is implement a price change for the product in the card when changing the option. Through JS, not willingly - I found this module here . It works well but only for the product page - it does not work on my product card on the main page.

I got into the archive with the module and realized that I need to edit the install.xml file inside the archive. Specifically, line 131 where the path for the processed template is indicated. I entered the path to the "Recommended" module there. I installed the resulting module, but it is not displayed in the list of modifiers, although it is installed normally.

The most incomprehensible thing for me is the fact that if you return the old code in the extension (as it was immediately after the jump), then it will not start working normally again. How is this possible? Edit protection?
I even tried to recreate the extension myself by creating the file structure myself and copying the code into them - but that didn’t help either, the same behavior - it works until you start making changes, and then even returning the initial code doesn’t help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VVCh, 2020-09-20
@VVCh

Everything is so
messy okmod is a set of instructions on what, where and how to change
After installation and updating, the files are changed and saved in a special folder
But!!! If you hit a template (twig), then after that you still need to reset the twig cache

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question