[eluser]vitoco[/eluser]
Try this
Code:
// ERROR REPORTING
error_reporting( E_ALL );
// IS THIS NECCESARY ???
$this->order = $this->session->userdata('order'); //saving order content to the array ..???
if(isset($_POST['submitted']))
{
//
$order_array = $this->session->userdata('order');
foreach($this->input->post('qty') as $k => $v)
{
$id = (int)$k;
$qty_ = (int)$v;
if ( ($qty_ == 0) OR ($qty_ < 0) )
{
// delete product if exists
if( isset( $order_array[$id] ) )
{
unset( $order_array[$id] );
}
}
else
{
//
$order_array[$id] = $qty_;
}
}
//
$this->session->set_userdata('order', $order_array );
}