session = session(); $this->UserModel = new User_model(); $this->dModel = new Dashboard_model(); $this->cModel = new Common_model(); $this->creditsModel = new Member_credits_model(); $this->PackagesModel = new Packages_and_pricing_model(); $this->CreditsUsageTrackingModel = new Credits_usage_tracking_model(); $this->MailModel = new Email_template_model(); $this->VariableModel = new Variable_model(); $this->RuleModel = new Rule_model(); $this->Cart_token_model = new Cart_token_model(); helper(['form', 'url']); } public function index($token = null) { $count = $this->request->getVar('count'); foreach ($count as $key => $value) { $this->Cart_token_model->where('id', $this->request->getVar('cart_token_id')[$key] )->set(array( 'count' => $value ))->update(); } if(!session()->has('logged_user')) { $this->session->set('token',$token); return redirect()->to(base_url()); } else { echo 'gop'; } } // ----------------------------------------------- }