S
S
smoklew2016-02-03 16:02:45
PHP
smoklew, 2016-02-03 16:02:45

Any opencart experts?

Version of Opencart is 2.1.0.
There is an HTML content module. I place it under the main menu on the main page.
Next, I change its template to look like this: b5b1be49bfd6a51bd00518deca3cfdc9.jpg
Choice of clothing types, correspond to items from the submenu in the categories.
To do this, I need to add the Category variables to the html.php module controller, as they are added in the header controller, but I don’t know how to do it, and when I try to stupidly copy header.php into html.php , I get:
Fatal error: Class 'Controllermodulehtml' not found in C:\OpenServer\domains\montri\system\engine\loader.php on line 28
or like this:
Parse error: syntax error, unexpected $end, expecting T_FUNCTION in C:\OpenServer\domains\montri\ catalog\controller\module\html.php on line 52

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-02-03
@webinar

Variables get into templates from controllers. It makes no sense to push the code of one template into another. Since there are variables in header.php that are not passed to html.php. At the template level, this can only be done with javascript. You need to copy the variable formation logic and transfer it to another controller or action.
Read about MCV.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question