Hi,
You would have to change the URL.
So instead of :
$clear_url=hikashop::completeLink('product&task=cleancart',false,true);
you would have something like that:
$clear_url=hikashop::completeLink('product&task=updatecart&cart_id=XXX&cart_type=YYY&item[AAA]=BBB,false,true);
where XXX is the id of the cart/wishlist, YYY is either "cart" or "wishlist", AAA is the id of the product in the cart (the value cart_product_id from the hikashop_cart_product table) and BBB is the quantity you want in the cart/wishlist, so 0 if you want to remove it.