public function beforeFilter() { parent::beforeFilter(); if (!$this->userManager->isLoggedIn() && strtolower($this->params['action']) != 'login') { $this->Session->setFlash('You do not have access to that page, please login first!', 'default', array('class' => 'alert alert-danger')); $this->redirect('/DrexCartProducts/index'); } }
public function beforeFilter() { parent::beforeFilter(); if (sizeof($this->cart->getProducts()) == 0) { $this->Session->setFlash('You must have products in your cart to checkout!', 'default', array('class' => 'alert alert-danger')); $this->redirect('/DrexCartCarts/cart'); exit; } }
public function beforeFilter() { parent::beforeFilter(); $this->layout = 'DrexCart.admin'; }