Hey Nicolas!
Thank you for your quick response and for pointing me in the right direction.
My components/com_hikashop/views/user/view.html.php file looks like that before changing anything:
$select = 'o.order_id, o.order_created, f.*, p.* ';
$selectSum = ', MIN(o.order_created) as min_order_created, MAX(o.order_created) as max_order_created, SUM(p.order_product_quantity) as file_quantity ';
$selectUniq = ', IF( REPLACE(LEFT(f.file_path, 1) , \'#\', \'@\') = \'@\', CONCAT(f.file_id, \'@\', o.order_id), f.file_id ) as uniq_id';
$query = ' FROM '.hikashop_table('order').' AS o ' .
' INNER JOIN '.hikashop_table('order_product').' AS p ON p.order_id = o.order_id ' .
' INNER JOIN '.hikashop_table('file').' AS f ON p.product_id = f.file_ref_id ' .
' WHERE ' . $filters;
$groupBy = ' GROUP BY uniq_id ';
Unfortunately your suggestion breaks the code and I get an error 1151:
Error: 1051
Unknown table 'op' SQL=SELECT o.order_id, o.order_created, p.*, f.*, op.* , MIN(o.order_created) as min_order_created, MAX(o.order_created) as max_order_created, SUM(p.order_product_quantity) as file_quantity , IF( REPLACE(LEFT(f.file_path, 1) , '#', '@') = '@', CONCAT(f.file_id, '@', o.order_id), f.file_id ) as uniq_id FROM dcbs1_hikashop_order AS o INNER JOIN dcbs1_hikashop_order_product AS p ON p.order_id = o.order_id INNER JOIN dcbs1_hikashop_file AS f ON p.product_id = f.file_ref_id WHERE o.order_type = 'sale' AND o.order_status IN ('shipped','confirmed') AND f.file_ref_id > 0 AND f.file_type = 'file' AND o.order_user_id = 5 GROUP BY uniq_id ORDER BY max_order_created desc LIMIT 0, 20
Any suggestions?