how clear hikashop cart session in every 5 miunuets? when user add item in cart, if under 5 minutes , do not payment process , empty cart for user . some code of hikashop cart.php
function addToCartFromFields(&$entriesData,&$fields){
$this->resetCart(false);
$app = JFactory::getApplication();
$productsToAdd = array();
$coupons = array();
foreach($entriesData as $entryData){
foreach(get_object_vars($entryData) as $namekey=>$value){
foreach($fields as $field){
if($field->field_namekey == $namekey){
$ok = false;
if(!empty($field->field_options) && !is_array($field->field_options))
$field->field_options = hikashop_unserialize($field->field_options);
if(!empty($field->field_options['product_id'])){
if(is_numeric($value) && is_numeric($field->field_options['product_value'])){
if( $value === $field->field_options['product_value'] ){
$ok = true;
}
}elseif(is_string($value) && !empty($field->field_options['product_value']) && is_array($field->field_options['product_value']) && in_array($value,$field->field_options['product_value'])){
$ok = true;
}elseif($value == $field->field_options['product_value']){
$ok = true;
}
if($ok){
$id = $field->field_options['product_id'];
if(empty($productsToAdd[$id])){
$productsToAdd[$id]=1;
}else{
$productsToAdd[$id]++;
}
}
}
if($field->field_type=='coupon' && !empty($field->coupon[$value])){
$coupons[] = $field->coupon[$value];
}
break;
}
}
}
}