Hi,
I don't know why but i can't do a pull request so i post it here so someone who can maybe wil doe this.
Delete single item of cart:
Code:
function destroy($row_id = FALSE)
{
if($row_id === FALSE){
unset($this->_cart_contents);
$this->_cart_contents['cart_total'] = 0;
$this->_cart_contents['total_items'] = 0;
$this->CI->session->unset_userdata('cart_contents');
}else{
unset($this->_cart_contents[$row_id]);
$this->_save_cart();
}
}
Update options of cart item:
Code:
if ($this->_cart_contents[$items['rowid']]['qty'] == $items['qty'] && $this->_cart_contents[$items['rowid']]['options'] == $items['options'])
{
return FALSE;
}
// Is the quantity zero? If so we will remove the item from the cart.
// If the quantity is greater than zero we are updating
if ($items['qty'] == 0)
{
unset($this->_cart_contents[$items['rowid']]);
}
else
{
$this->_cart_contents[$items['rowid']]['qty'] = $items['qty'];
$this->_cart_contents[$items['rowid']]['options'] = $items['options'];
}
if(!$this->_cart_contents[$items['rowid']]['options'] == $items['options']){
$this->_cart_contents[$items['rowid']]['options'] = $items['options'];
}
Hoop someone find this useful,
Stefan Fransen