Hi,
Cant find any solution, I want to force customer to login first,
I found something like this:
Create a class catalog/controller/common/login.php
class ControllerCommonLogin extends Controller {
public function index() {
if($this->config->get('config_store_id') == 1) { // if desired store, continue checking
if(!$this->customer->isLogged()) { // Check user isn't logged in
if(empty($this->request->get['route']) || $this->request->get['route'] != 'account/login') { // Redirect if route isn't account/login
$this->redirect($this->url->link('account/login', '', 'SSL'));
}
}
}
}
}
Then open up index.php (frontend one) and find line:
// Maintenance Mode
$controller->addPreAction(new Action('common/maintenance'));
and after add this:
// Login needed pre-action
$controller->addPreAction(new Action('common/login'));
I cant find maintenance line in index.php, im using OC 2.3
Anyone please?
anyone please?
where should I put this: $this->response->redirect($this->url->link('account/login'));
Is it at: /catalog/controller/common/header.php???
where should I put this: $this->response->redirect($this->url->link('account/login'));
Is it at: /catalog/controller/common/header.php???
Solve,
catalog/controller/common/home.php:
$this->response->redirect($this->url->link('account/login', '', ''));
catalog/controller/common/home.php:
$this->response->redirect($this->url->link('account/login', '', ''));
Who is online
Users browsing this forum: Amazon [Bot], Majestic-12 [Bot] and 47 guests