var_dump(sesji) wyswietla mi cos takiego
array(6) { ["session_id"]=> string(32) "1fce778964e67409ced643daa9542fb1" ["ip_address"]=> string(9) "127.0.0.1" ["user_agent"]=> string(109) "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36" ["last_activity"]=> int(1415028136) ["user_data"]=> string(0) "" ["cart_contents"]=> array(3) { ["3d6cef782694c3ae6de46e04be484f01"]=> array(7) { ["rowid"]=> string(32) "3d6cef782694c3ae6de46e04be484f01" ["id"]=> string(1) "6" ["qty"]=> string(1) "1" ["price"]=> string(6) "100.00" ["name"]=> string(1) "c" ["options"]=> array(2) { ["producent"]=> string(1) "c" ["description"]=> string(1) "c" } ["subtotal"]=> float(100) } ["total_items"]=> int(1) ["cart_total"]=> float(100) } }
koszyk zapisuje sie za pomoca funkcji wbudowanej w klasie moj kog wyglada tak
public function add_item()
{
$where = array('id_products' => $this->uri->segment(3), );
$data = $this->site_m->get('products', $where, TRUE);
$item = array(
'id' => $data->id_products,
'qty' => '1',
'price' => $data->price,
'name' => $data->name_products,
'options' => array(
'producent' => $data->producent,
'description' => $data->description,),
);
$this->cart->insert($item);
redirect('cart/');
}
i wprawdzie tkwi w tym problem ze nie moge usunac z tablicy cart_content zadnej tablicy, a tablice cart_content bez problemu usuwa.