-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.5.x
Hello,
this is probably very easy for you developers of Hikashop, but I'am stuck.
We've written a very simple Plugin to automaticaly add a product on after the cart gets updated, that creates an infinite loop 
public function onAfterCartUpdate(&$cartClass,&$cart,$product_id,$quantity,$add,$type,$resetCartWhenUpdate,$force){
//die(print_r($product_id));
//if( $product_id != '17962' ){ Does not work because $product_id is an Array, and the id is either the "real" product id, or the id from the table "hikashop_cart_product", which I do not know
$c = $cartClass->loadFullCart();
if( count($c->products) ){
$sum = 0;
foreach($c->products as $i => $product){
if( !empty($product->length) ){ // if product has custom field "length"
$sum += $product->cart_product_quantity - 1; // that "- 1" is willed...
}
}
$cartClass->update('17962', $sum); // infinite loop
}
//}
}
EDIT: Sorry for not setting the right forum category.