Adding Pirce '0' item to CI's shopping cart

bob

New Member
I am making a solution with CI. We have items (free items) that price is '0' . (Free of charge) (example : glass of water).this is my model\[code\]function addcartdetail(){ $id=rand(1, 99999999999999); $syskey=$_POST['syskey']; $qty =$_POST['quantity']; $name=$_POST['description']; $price = $_POST['price']; $order=array( 'id'=>$id, 'syskey'=>$syskey, 'qty'=>$qty, 'price'=>$price, 'name'=>$name ); $data=http://stackoverflow.com/questions/15855359/$order; $this->cart->insert($data); } \[/code\]This is my view, for your convenience I had remove the unnecessary parts\[code\]foreach ($menus as $menus_items): echo ' $S '.$menus_items['price']; echo '<input type="hidden" name="price" id="price" value="'.$menus_items['price'].'">';endforeach;\[/code\]My problem is I can add if price is >0 , but can't if =0 .(p.s Solution is built with CI Cart)
 
Back
Top