Hi,
I would rather do like this:
if(!@include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')){ return false; }
if ( ($key = array_search($product->product_id, $order->products) ) !== false) {
$product_id = $order->products[$key]->product_id;
$order_product_id = $order->products[$key]->order_product_id;
}
hikaInput::get()->set('cid', $order->order_id);
hikaInput::get()->set('order_product_id', $order_product_id);
$orderClass = hikashop_get('class.order');
$status = $orderClass->saveForm('product_delete');
That's basically the code in the task "product_remove" of the "order" controller, which is behind the delete button of each product on the listins of products of an order on the backend interface.