[eluser]dojolab[/eluser]
Hello, I have e simple problem with CodeIgniter Cart Library; this is my 'add' method of my Cart Controller.
Code:
function add() {
// CART ID (FOR DB STORAGE)
if($this->session->userdata('cart_sid') == FALSE) {
$cart_sid = md5(time()); // cart id.
$data = array(
'cart_sid' => (string) $cart_sid
);
$this->session->set_userdata($data);
}
$data =
array(
'id' => (string) $this->input->post('product_code'),
'qty' => (int) $this->input->post('product_quantity'),
'price' => (float) $this->input->post('product_price'),
'name' => (string) $this->input->post('product_name')
);
$this->cart->insert($data);
}
Where is the problem?
When I added the FIRST product/item to cart there is no problem.
When I added the SECOND product/item to cart (by add method), the item is not inserted...
Why? The POST debug works correctly!
Thanks for reply!