Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

[Решено] Сокрытие модулей для гостей


Recommended Posts

Собственно сабж.

Хотелось бы некоторые пункты меню/группы товаров/модули "специальные предложения"/сайтмап (все это для примера) выводить только залогинившимся покупателям (а в игдено - опрегделенным группам). Подскажите как должно выглягдеть условие и ггде лучше его править (понимаю что в темплейих, но может есть метод на уровне движка?)

Link to comment
Share on other sites


$this->customer->isLogged() - возвращает TRUE если залогинился, FALSE если гость.

$this->customer->getCustomerGroupId() - возвращает id группы, текуещёго пользователя.

куда их всивлять зависит только от вашей фанизии =)

  • +1 1
Link to comment
Share on other sites


$this->customer->isLogged() - возвращает TRUE если залогинился, FALSE если гость.

$this->customer->getCustomerGroupId() - возвращает id группы, текуещёго пользователя.

куда их всивлять зависит только от вашей фанизии =)

Чтото моя фанизия не срабатывает.

насколько я понимаю все должно быть:

<?php if ($this->customer->isLogged()) { ?>.....код модуля......<?php } ?>

но что-то не рилииет. =(

Link to comment
Share on other sites


это в контроллере надо вписывать, а не в шаблоне.

$this->data['visible'] = $this->customer->isLogged();

а в шаблоне уже

<?php if ($visible) { ?>.....код модуля......<?php } ?>
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.