<?php ; 
wp_reset_postdata();
$default = array(
	'post_type'		=> 'product',		
	'post_status' 	=> 'publish',
	'no_found_rows' => 1,					
	'showposts' 	=> $numberposts	,
	'orderby' => $orderby,
	'order' => $order,
    'post_in'	=> array_merge( array( 0 ), wc_get_product_ids_on_sale() )		
);
if( $category ){	
	$default['tax_query'] = array(
		array(
			'taxonomy'	=> 'product_cat',
			'field'		=> 'slug',
			'terms'		=> $category,
		)
	);
}
$default = sw_check_product_visiblity( $default );

$id = 'sw_toprated_'.rand().time();
$list = new WP_Query( $default );
$countdown_time = strtotime( $date );
$today = time();

if ( $list -> have_posts() ){
?>
	<div id="<?php echo $id; ?>" class="sw-woo-container-slider  responsive-slider dailydeals-product15 loading" data-row="<?php echo esc_attr( $item_row ); ?>" data-lg="<?php echo esc_attr( $columns ); ?>" data-md="<?php echo esc_attr( $columns1 ); ?>" data-sm="<?php echo esc_attr( $columns2 ); ?>" data-xs="<?php echo esc_attr( $columns3 ); ?>" data-mobile="<?php echo esc_attr( $columns4 ); ?>" data-speed="<?php echo esc_attr( $speed ); ?>" data-dots="false" data-scroll="<?php echo esc_attr( $scroll ); ?>" data-interval="<?php echo esc_attr( $interval ); ?>"  data-autoplay="<?php echo esc_attr( $autoplay ); ?>">
		<div class="box-slider-top">
			<?php if( $title1 != '' ){
				$titles = strpos($title1, ' ');
			?>
			<div class="block-title clearfix">
				<h3><span><?php echo substr( $title1, 0, $titles ); ?></span><?php echo str_replace( substr( $title1, 0, $titles ),'', $title1 ); ?></h3>
			</div>
			<?php } ?>
			<div class="deal-description"><?php echo esc_html__( 'Up to ', 'emarket' ) ; ?><span><?php echo ( $description != '' ) ? $description : ''; ?></span><?php echo esc_html__( ' off', 'emarket' ) ;?></div>
			<div class="deal-bottom">
				<h4><?php echo esc_html__( 'Hurry up! Offers end in:', 'emarket' ) ; ?></h4>
				<?php if( $countdown_time > $today  ): ?><div class="item-countdown3" data-cdtime="<?php echo esc_attr( $countdown_time ); ?>"></div><?php else: ?><span class="message-cd"><?php echo esc_html__('Please select a time for layout.','emarket'); ?></span><?php endif; ?>
			</div>
		</div>
		<div class="resp-slider-container">
			<div class="slider responsive">			
			<?php							 
				while($list->have_posts()): $list->the_post();
					wc_get_template_part( 'content', 'product' );
				endwhile; wp_reset_postdata();				
			?>	
			</div>
		</div>					
	</div>
<?php
}	
?>