Thanks for the reply. I have another idea before I start doing this. Can I insert the view through this code?
<?php
$this->setLayout('show_block_product_files');
echo $this->loadTemplate();
?>
I want to ask what is the value of $ids in
$query = 'SELECT * FROM #__hikashop_order_product as op '.
'LEFT JOIN #__hikashop_order AS o ON op.order_id = o.order_id '.
'LEFT JOIN #__hikashop_product AS p ON op.product_id = p.product_id '.
'WHERE o.order_user_id = ' . $user->user_id . ' '.
'AND op.product_id IN (' . implode(',', $ids) . ') '.
'AND o.order_status IN (' . implode(',', $statuses) . ')';
$db->setQuery($query);
$orders = $db->loadObjectList('order_id');