CodeIgniter Forums
Cart doesn't add another item - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Cart doesn't add another item (/showthread.php?tid=27746)



Cart doesn't add another item - El Forum - 02-19-2010

[eluser]Fero[/eluser]
Hi,

I've added one item to Cart, but another one doesn't want to get added.

Function that takes ID of item in database and adds it to cart is here:
Code:
function pridat($id)
  {
  $query=$this->db->get_where('produkty',array('id_produkty'=>$id,'status'=>'1'));
  
  If ($query->num_rows==0) return false;
  
  $produkt=$query->row();
  
  $data = array(
               'id'      => $produkt->id_produkty,
               'qty'     => 1,
               'price'   => $produkt->cena_vysledna,
               'name'    => $produkt->nazov,
            );

  $this->cart->insert($data);
  return true;
}



Cart doesn't add another item - El Forum - 02-19-2010

[eluser]Fero[/eluser]
Of course, I do not try to add the same item twice. It's different item with different id.

database is setup - ci_sessions is running in DB, also the config is setup on TRUE for database for session.. I am not sure where the mistake is Sad


Cart doesn't add another item - El Forum - 02-19-2010

[eluser]Fero[/eluser]
solved, I am also using diacritics, had to comment line in cart.php ^ ^ I wonder why this isn't in documentation, ...