if(!empty($this->order)) {
$filename = rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikaserial'.DS.'helpers'.DS.'helper.php';
if(file_exists($filename) && include_once($filename)) {
$db = JFactory::getDBO();
$serialConfig = hikaserial::config();
$display_serial_statuses = $serialConfig->get('display_serial_statuses','');
if(empty($display_serial_statuses))
$display_serial_statuses = array($serialConfig->get('used_serial_status','used'));
else
$display_serial_statuses = explode(',', $display_serial_statuses);
foreach($display_serial_statuses as &$s) {
$s = $db->Quote($s);
}
unset($s);
$query = 'SELECT serial.*, pack.*, order_product.*, u.user_cms_id FROM '.
hikaserial::table('serial') . ' as serial '.
'INNER JOIN '. hikaserial::table('pack') . ' as pack ON serial.serial_pack_id = pack.pack_id '.
'LEFT JOIN ' . hikaserial::table('shop.order_product') . ' as order_product ON serial.serial_order_product_id = order_product.order_product_id '.
'LEFT JOIN ' . hikaserial::table('shop.user') . ' AS u ON serial.serial_user_id = u.user_id '.
'WHERE serial.serial_status IN ('.implode(',',$display_serial_statuses).') AND serial.serial_order_id = ' . $this->order->order_id;
$db->setQuery($query);
$serials = $db->loadObjectList();
//
// Display the serials with the variable $serials
//
}
}