}
?>
if ($prices) {
for ($p=0;$pinclude('ini.php'); include('tools.php'); //$IS_STAGING = false; if ($_GET['staging'] == 1 || $_SERVER['BIG5_LOCAL']) { //$IS_STAGING = true; } $display_msg = ''; $msgclass = 'msg-error'; $pageinfo = get_pageinfo(1); $giftpage = get_pageinfo(7, 'page_id, page_name_url'); include('html-header.php'); display_message($display_msg,$msgclass); $current_time = date("Y-m-d H:i:s"); $sql = "select * from products where deal_active = 1 "; $sql.= "and deal_date_start <= '".$current_time."' "; $sql.= "and deal_date_end >= '".$current_time."' "; $sql.= "and pro_visible = 1 "; $sql.= "order by deal_date_start asc limit 0, 3 "; $query->run_query($sql,__FILE__,__LINE__); while ($query->fetch_array(__FILE__,__LINE__)) { $DEALS_DATA[] = $query->data; $pro_ids[] = $query->data['pro_id']+0; if (!isset($deal_end) || $deal_end > $query->data['deal_date_end']) { $deal_end = $query->data['deal_date_end']; } } $query->free_result(); $deal_end = strtotime($deal_end); //print '
'; print_r($DEALS_DATA); print ''; if ($pro_ids) { $sql = "select * from products_photos where file_default = 1 and foreign_id in (".implode(",", $pro_ids).") "; $query->run_query($sql,__FILE__,__LINE__); $default_photo_id = 0; while ($query->fetch_array(__FILE__,__LINE__)) { $PRODUCTS_PHOTOS[$query->data['foreign_id']] = $query->data; } $query->free_result(); $sql = "select * from products_variants where pro_id in (".implode(",", $pro_ids).") "; $sql.= "and var_is_special = 1 "; // $sql.= "and ( (var_is_special = 0 and var_price > 0) OR (var_is_special = 1 and var_sprice > 0) ) "; // this cause problem when product already fetched, but, there is no variant, it will display standard price instead. // disable Add to Cart button at the product detail page instead. $sql.= "order by pro_id, var_price, var_sort_order asc "; $query->run_query($sql,__FILE__,__LINE__); while ($query->fetch_array(__FILE__,__LINE__)) { $DEAL_PRICES_DATA[$query->data['pro_id']][] = $query->data; } $query->free_result(); } if ($DEALS_DATA) { ?>
| } ?> |