Subversion Repositories SmartDukaan

Rev

Rev 12056 | Rev 16044 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12056 Rev 16038
Line 52... Line 52...
52
			unset($configdata['module']['response'][0]);
52
			unset($configdata['module']['response'][0]);
53
			$data['response']=$this->cart_model->getCart($this->input->get(),$this->input->post(),$configdata['module']);
53
			$data['response']=$this->cart_model->getCart($this->input->get(),$this->input->post(),$configdata['module']);
54
			if(isset($data['response']['response']['carts'][0]->lines))
54
			if(isset($data['response']['response']['carts'][0]->lines))
55
			$cartCount = sizeof($data['response']['response']['carts'][0]->lines);
55
			$cartCount = sizeof($data['response']['response']['carts'][0]->lines);
56
			$authorized = $this->session->userdata('authorized');
56
			$authorized = $this->session->userdata('authorized');
-
 
57
			if(isset($cartMessage) and !empty($cartMessage))
-
 
58
			{
-
 
59
				print_r($cartMessage);
-
 
60
				if(!isset($data['response']['response']['carts'][0]->message) and empty($data['response']['response']['carts'][0]->message)){
-
 
61
					$data['response']['response']['carts'][0]->message = $cartMessage;
-
 
62
				}
-
 
63
			}
57
			if(isset($authorized) && !empty($authorized)){
64
			if(isset($authorized) && !empty($authorized)){
58
				$newValues = $authorized;
65
				$newValues = $authorized;
59
				$newValues['totalItems'] = $cartCount;
66
				$newValues['totalItems'] = $cartCount;
60
				$this->session->set_userdata('authorized',$newValues);
67
				$this->session->set_userdata('authorized',$newValues);
61
			}
68
			}
Line 89... Line 96...
89
				}
96
				}
90
			}
97
			}
91
			setCache($configdata['module'],$cachemodule,$data['response']);
98
			setCache($configdata['module'],$cachemodule,$data['response']);
92
			$this->layout->view('cart/carts',$data);
99
			$this->layout->view('cart/carts',$data);
93
		}
100
		}
-
 
101
		$cartMessage = $this->session->userdata('cartmessage');
-
 
102
        if(isset($cartMessage) and !empty($cartMessage))
-
 
103
        {
-
 
104
        	if(!isset($data['response']['response']['carts'][0]->message) or empty($data['response']['response']['carts'][0]->message)){
-
 
105
                print_r('Mesaage'.$data['response']['response']['carts'][0]->message.'\n');
-
 
106
                $data['response']['response']['carts'][0]->message=$cartMessage;
-
 
107
            }
-
 
108
        }
-
 
109
		
94
	}
110
	}
95
 
111
 
96
	
112
	
97
	public function add($id=null,$email=null,$itemname)
113
	public function add($id=null,$email=null,$itemname)
98
	{
114
	{
Line 181... Line 197...
181
			}
197
			}
182
			elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
198
			elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
183
				$_POST['isLoggedIn'] = 'false';
199
				$_POST['isLoggedIn'] = 'false';
184
			}
200
			}
185
		}
201
		}
186
		$response=$this->cart_model->getCart($this->input->get(),$this->input->post(),$this->config->item('cart_update'),$cartId);
202
		$data['response']=$this->cart_model->getCart($this->input->get(),$this->input->post(),$this->config->item('cart_update'),$cartId);
-
 
203
		$message = $data['response']['response']['updatecart'][0]->message;
-
 
204
        
-
 
205
        if(isset($message) and !empty($message))
-
 
206
        {
-
 
207
            $this->session->set_userdata('cartmessage',$message);
-
 
208
            redirect(base_url().strtolower(__CLASS__));
-
 
209
        }else{
187
		redirect(base_url().strtolower(__CLASS__));
210
            redirect(base_url().strtolower(__CLASS__));
188
			
211
        }	
189
	}
212
	}
190
	public function delete($id=null)
213
	public function delete($id=null)
191
	{
214
	{
192
 
215
 
193
		$authorized = $this->session->userdata('authorized');
216
		$authorized = $this->session->userdata('authorized');