CodeIgniter Forums
update cart with new price? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: update cart with new price? (/showthread.php?tid=60019)



update cart with new price? - El Forum - 12-29-2013

[eluser]teddy[/eluser]
how to update the cart price ?
Example if I have order great than 10 items (the same SKU) the price is 100 else is 150
I try add some code with the price is set 1 but not this working for me?

help me,pls !!! below is my code

Code:
$item = $this->input->post('rowid');  
$qty = $this->input->post('qty');
$total = count($this->cart->contents());

if ($total>0)
{

for ($i=0; $i <$total ; $i++)
  {
   $data = array('rowid' => $item[$i], 'qty' => $qty[$i],'price'=>1);  
   $this->cart->update($data);
  }      
    
}



update cart with new price? - El Forum - 01-02-2014

[eluser]teddy[/eluser]
solve, mod please close topic