if ((int)$qty && ((int)$qty > 0)) { $this->session->data['cart'][$key] = (int)$qty; } else { $this->remove($key); } $this->data = array();