= '".$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) { ?>
WEEKLY DEALS END IN
run_query($sql,__FILE__,__LINE__); while ($query->fetch_array(__FILE__,__LINE__)) { $SLIDESHOW_PHOTOS[] = $query->data; } $query->free_result(); if ($SLIDESHOW_PHOTOS) { ?>
@PawBoxNZ