Another way to clean the cart could be to jsut create a new cart for the current user.
Like it's done in the "newcart()" function in the frontend cart controller.
The content of the function is:
$app = JFactory::getApplication();
$cartClass = hikashop_get('class.cart');
$cart_type = JRequest::getString('cart_type','cart');
// set all the user carts cart_current to 0 in DB
$result = $cartClass->setCurrent('0',$cart_type);
// Create a new cart
$session = JFactory::getSession();
$curUser = hikashop_loadUser(true);
$newCart = new stdClass();
if($curUser == null)
$newCart->user_id = 0;
else
$newCart->user_id = $curUser->user_cms_id;
$newCart->session_id = $session->getId();
$newCart->cart_modified = time();
$newCart->cart_type = $cart_type;
$newCart->cart_current = 1;
$newCart->cart_share = 'nobody';
$cartClass->save($newCart);
// EO Create a new cart
// set the current cart to 0 in session.
$app->setUserState(HIKASHOP_COMPONENT.'.'.$cart_type.'_id', '0');
// set the "new_cart" parameter in session
$app->setUserState(HIKASHOP_COMPONENT.'.'.$cart_type.'_new', '1');
You need to adapt it for the plugin.