[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;
}