public function update($items = array())
{
// Was any cart data passed?
if (!is_array($items) or count($items) === 0) {
return FALSE;
}
// You can either update a single product using a one-dimensional array,
// or multiple products using a multi-dimensional one. The way we
// determine the array type is by looking for a required array key named "rowid".
// If it's not found we assume it's a multi-dimensional array
$save_cart = FALSE;
if (isset($items['rowid'])) {
if ($this->_update($items) === TRUE) {
$save_cart = TRUE;
}
} else {
foreach ($items as $val) {
if (is_array($val) && isset($val['rowid'])) {
if ($this->_update($val) === TRUE) {
$save_cart = TRUE;
}
}
}
}
// Save the cart data if the insert was successful
if ($save_cart === TRUE) {
$this->_save_cart();
return TRUE;
}
return FALSE;
}