Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Как вывести id модуля


Recommended Posts

В контроллере админки записываете его в БД. В контроллере сайта уже передаёте в шаблон.

 

Link to comment
Share on other sites

То есть в admin/extension/module/viewed

 

if (!isset($this->request->get['module_id'])) {
                $result = $this->request->post;
                $result[''module_id'] =$this->request->get['module_id'];
                $this->model_extension_module->addModule('viewed', $result);
}

Link to comment
Share on other sites

nexus, прошу прощение за еще один вопрос, но можете подсказать что должно быть в контроллере каталога (я не очень хорошо знаю опенкарт)?

Link to comment
Share on other sites


Только что, sashamaximiv сказал:

nexus, прошу прощение за еще один вопрос, но можете подсказать что должно быть в контроллере каталога (я не очень хорошо знаю опенкарт)?

 

$data['module_id'] = $setting['module_id'];

Link to comment
Share on other sites

Только что, sashamaximiv сказал:

nexus, еще раз спасибо)

 

Еще раз на здоровье =))

Link to comment
Share on other sites

  • 6 years later...

на просторах интернета нашел отличный универсальный способ.


Открыть файл модели \catalog\model\extension\module.php


найти

return json_decode($query->row['setting'], true);


заменить на

            $settings = json_decode($query->row['setting'], true);
            $settings['module_id'] = $module_id;
            return $settings;


далее это в нужный контроллер

$data['sid'] = $setting['module_id'];


В файл twig 3.xxx

{{ $sid }}

 

в файл tpl 2.xxx
 

<?php echo $sid; ?>

 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.