How can I remove a single cart item using the catignign cart class?
I am using the cartignign class for my shopping cart project. I have a number of items on the cart. Now I have a cart id. Now, what I need to do is to remove a specific item from the cart, not all of the contents (Destroying cart).
$cartcontents = $this->cart->product_options($rowid);
and send out all content. but doesn't work. Please help you who have an idea. Thank.
+3
source to share
4 answers
Create a delete button on the view page and add the line id with the link. After that create a function and pass the string id and put the count 0 and pass this array in the update function.
public function remove_cart_product($data) {
$row_id=$data;
$qty=0;
$array=array('rowid' =>$row_id ,'qty'=>$qty );
$this->cart->update($array);
print_r($this->cart->contents());exit();
}
0
source to share