| Line 25... |
Line 25... |
| 25 |
|
25 |
|
| 26 |
}
|
26 |
}
|
| 27 |
public function index()
|
27 |
public function index()
|
| 28 |
{
|
28 |
{
|
| 29 |
$authorized = $this->session->userdata('authorized');
|
29 |
$authorized = $this->session->userdata('authorized');
|
| - |
|
30 |
error_log("[cart] authorized ".print_r($authorized,1));
|
| 30 |
//standard array
|
31 |
//standard array
|
| 31 |
$configdata = $this->config->item('cart');
|
32 |
$configdata = $this->config->item('cart');
|
| 32 |
//$checkConfig = $this->config->item('home');
|
33 |
//$checkConfig = $this->config->item('home');
|
| 33 |
$cachemodule = array('header','footer');
|
34 |
$cachemodule = array('header','footer');
|
| 34 |
$configdata = getCache($configdata,$cachemodule);
|
35 |
$configdata = getCache($configdata,$cachemodule);
|
| - |
|
36 |
error_log("[cart] configdata ".print_r($authorized,1));
|
| 35 |
$data = array();
|
37 |
$data = array();
|
| 36 |
if(isset($authorized) && !empty($authorized)){
|
38 |
if(isset($authorized) && !empty($authorized)){
|
| 37 |
$_GET['userId'] = $authorized['Id'];
|
39 |
$_GET['userId'] = $authorized['Id'];
|
| 38 |
$_GET['Id'] = $authorized['cartId'];
|
40 |
$_GET['Id'] = $authorized['cartId'];
|
| 39 |
if($authorized['isLoggedIn'] == 1){
|
41 |
if($authorized['isLoggedIn'] == 1){
|
| Line 42... |
Line 44... |
| 42 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
44 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
| 43 |
$_GET['isLoggedIn'] = 'false';
|
45 |
$_GET['isLoggedIn'] = 'false';
|
| 44 |
}
|
46 |
}
|
| 45 |
unset($configdata['module']['response'][0]);
|
47 |
unset($configdata['module']['response'][0]);
|
| 46 |
$data['response']=$this->cart_model->getCart($this->input->get(),$this->input->post(),$configdata['module']);
|
48 |
$data['response']=$this->cart_model->getCart($this->input->get(),$this->input->post(),$configdata['module']);
|
| - |
|
49 |
error_log("[cart] authorized response ".print_r($data['response'],1));
|
| 47 |
//print_r($data['response']['response']['carts']);
|
50 |
//print_r($data['response']['response']['carts']);
|
| 48 |
if(isset($data['response']['response']['carts'][0]->lines))
|
51 |
if(isset($data['response']['response']['carts'][0]->lines))
|
| 49 |
$cartCount = sizeof($data['response']['response']['carts'][0]->lines);
|
52 |
$cartCount = sizeof($data['response']['response']['carts'][0]->lines);
|
| 50 |
$authorized = $this->session->userdata('authorized');
|
53 |
$authorized = $this->session->userdata('authorized');
|
| 51 |
if(isset($authorized) && !empty($authorized)){
|
54 |
if(isset($authorized) && !empty($authorized)){
|
| Line 68... |
Line 71... |
| 68 |
setCache($configdata['module'],$cachemodule,$data['response']);
|
71 |
setCache($configdata['module'],$cachemodule,$data['response']);
|
| 69 |
$this->layout->view('cart/cart_view',$data);
|
72 |
$this->layout->view('cart/cart_view',$data);
|
| 70 |
}else{
|
73 |
}else{
|
| 71 |
unset($configdata['module']['response'][1]);
|
74 |
unset($configdata['module']['response'][1]);
|
| 72 |
$data['response']=$this->cart_model->getCart($this->input->get(),$this->input->post(),$configdata['module']);
|
75 |
$data['response']=$this->cart_model->getCart($this->input->get(),$this->input->post(),$configdata['module']);
|
| - |
|
76 |
error_log("[cart] unauthorized response ".print_r($data['response'],1));
|
| 73 |
$this->lessphp->object()->ccompile('assets/css/cart.less','assets/css/cart.css');
|
77 |
$this->lessphp->object()->ccompile('assets/css/cart.less','assets/css/cart.css');
|
| 74 |
$data['stylesheet'] = 'cart.css';
|
78 |
$data['stylesheet'] = 'cart.css';
|
| 75 |
if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
|
79 |
if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
|
| 76 |
{
|
80 |
{
|
| 77 |
foreach($cachemodule as $cm)
|
81 |
foreach($cachemodule as $cm)
|
| Line 361... |
Line 365... |
| 361 |
public function delete_ajax()
|
365 |
public function delete_ajax()
|
| 362 |
{}
|
366 |
{}
|
| 363 |
}
|
367 |
}
|
| 364 |
|
368 |
|
| 365 |
/* End of file welcome.php */
|
369 |
/* End of file welcome.php */
|
| 366 |
/* Location: ./application/controllers/welcome.php */
|
- |
|
| 367 |
|
370 |
/* Location: ./application/controllers/welcome.php */
|
| - |
|
371 |
|