I would like to redirect a customer to the login page if they are not logged in from any page on the site. I am trying to limit access to a subdomain to a specific customer
You need to add a condition like:
if($this->config->get('config_store_id') == 1) { //Add your subdomain store id, if you want to limit the condition for a subdomain.
if( (!isset($this->request->get['route']) || $this->request->get['route'] != 'account/login' ) && (!$this->customer->isLogged()) ){
$this->redirect($this->url->link('account/login', '', 'SSL'));
}
}
$this->request->get['route'] - this will get you the current page path.