Php Opencart登录类别

Php Opencart登录类别,php,login,opencart,Php,Login,Opencart,我需要为所有类别创建一个登录,除了一个有自己ID的类别,比如“192” 在controller/category.php中,我添加了以下内容 if (!$this->customer->isLogged()) { $this->session->data['redirect'] = $this->url->link('account/account', '', 'SSL'); $this->redirect($this->url-&

我需要为所有类别创建一个登录,除了一个有自己ID的类别,比如“192”

在controller/category.php中,我添加了以下内容

if (!$this->customer->isLogged()) {
    $this->session->data['redirect'] = $this->url->link('account/account', '', 'SSL');
    $this->redirect($this->url->link('account/login', '', 'SSL'));
}
但这显然为所有类别添加了登录名


向上面的代码中添加什么是使类别“192”不必登录即可查看的最佳方法?

打开
catalog/controller/product/category.php
并将上面的代码从任何位置删除。然后找到

if ($category_info) {
在那之后,把

if (!$this->customer->isLogged() && $category_id != 192) {
    $this->session->data['redirect'] = $this->url->link('account/account', '', 'SSL');
    $this->redirect($this->url->link('account/login', '', 'SSL'));
}

谢谢你的回复,我会尝试一下,让你知道!