You can use this function to check if user is logged in:
Since you want specific category, than you can do something like this :
Add:
Where YOURID is the category's ID you want to hide.
Code: Select all
$this->customer->isLogged()
Code: Select all
edit /catalog/controller/product/category.php, just above $product_total = $this->model_catalog_product->getTotalProducts($filter_data);
Code: Select all
if(!$this->customer->isLogged() && $category_id == YOURID) {
//do something here
}
Check my FREE extension - Frontend Admin Toolbar
http://www.opencart.com/index.php?route ... n_id=26059
For any inquiry or questions contact me at: abxweb[at]outlook[dot]com
Hy
I add this code and I get fatal error
if(!$this->customer->isLogged() && $category_id == 71) {
$this->redirect($this->url->link('account/login', '', 'SSL'));
}
Michel
I add this code and I get fatal error
if(!$this->customer->isLogged() && $category_id == 71) {
$this->redirect($this->url->link('account/login', '', 'SSL'));
}
Michel
Version 2.1.0.1
Hébergement LWS
Template default modified
Multimerch modified
My friend, you need to use
That is the function for redirecting in Opencart 2.x
Cheers.
Code: Select all
$this->response->redirect()
Cheers.
Check my FREE extension - Frontend Admin Toolbar
http://www.opencart.com/index.php?route ... n_id=26059
For any inquiry or questions contact me at: abxweb[at]outlook[dot]com
Who is online
Users browsing this forum: No registered users and 12 guests