Welcome Guest, Not a member yet? Register   Sign In
Cart Class
#11

[eluser]craig.hoog[/eluser]
[quote author="the_unforgiven" date="1336572233"]Apologise, i had put it in the view file: after putting it in the controller i get this:

array(1) { [1]=> array(2) { ["rowid"]=> string(32) "a5bfc9e07964f8dddeb95fc584cd965d" ["qty"]=> string(1) "2" } } [/quote]

That is exactly what I expected to see.
You have an Array of posts.

Change your original code to this (for testing, not necessarily the most robust or efficient code):

Code:
if(isset($_POST) && $_POST != null)
{
foreach($_POST as $p)
{
  $update = array(
   'rowid' => $p['rowid'],
   'qty'   => $p['qty']
  );

  $this->cart->update($update);
}
$this->session->set_flashdata('message','Your shopping cart has been updated!');
}
redirect('home/cart','refresh');


Messages In This Thread
Cart Class - by El Forum - 05-09-2012, 04:41 AM
Cart Class - by El Forum - 05-09-2012, 05:47 AM
Cart Class - by El Forum - 05-09-2012, 06:03 AM
Cart Class - by El Forum - 05-09-2012, 06:15 AM
Cart Class - by El Forum - 05-09-2012, 06:40 AM
Cart Class - by El Forum - 05-09-2012, 06:41 AM
Cart Class - by El Forum - 05-09-2012, 06:53 AM
Cart Class - by El Forum - 05-09-2012, 06:58 AM
Cart Class - by El Forum - 05-09-2012, 07:00 AM
Cart Class - by El Forum - 05-09-2012, 07:03 AM
Cart Class - by El Forum - 05-09-2012, 07:07 AM
Cart Class - by El Forum - 05-09-2012, 07:10 AM
Cart Class - by El Forum - 05-09-2012, 07:14 AM
Cart Class - by El Forum - 05-09-2012, 07:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB