<?php 

/**
* Layout Default
* @version     1.0.0
**/
$widget_id = isset( $widget_id ) ? $widget_id : $this->generateID();
$term_name = esc_html__( 'All Categories', 'emarket' );
$viewall = get_permalink( wc_get_page_id( 'shop' ) );
$viewed_products = ! empty( $_COOKIE['woocommerce_recently_viewed'] ) ? (array) explode( '|', wp_unslash( $_COOKIE['woocommerce_recently_viewed'] ) ) : array(); // @codingStandardsIgnoreLine

$default = array(
	'post_type' => 'product',		
	'post_status' => 'publish',
	'showposts' => $numberposts,
	'no_found_rows'  => 1,
	'post__in'       => $viewed_products,
	'orderby'        => 'post__in',
);	

$default = sw_check_product_visiblity( $default );
$list = new WP_Query( $default );

if ( $list -> have_posts() ){ ?>
<div id="<?php echo 'slider_' . $widget_id.rand(); ?>" class="sw-woo-container-slider responsive-slider most-viewed6 <?php echo isset( $style ) ? esc_attr( $style ) : ''; ?> 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-scroll="<?php echo esc_attr( $scroll ); ?>" data-interval="<?php echo esc_attr( $interval ); ?>"  data-autoplay="<?php echo esc_attr( $autoplay ); ?>">
	<?php if( $title1 != '' ){?>
	<div class="box-title"><h3 class="<?php echo ( $style == 'style2' ? 'custom-font' : '' );?>"><span><?php echo ( $title1 != '' ) ? $title1 : $term_name; ?></span></h3></div>
	<?php } ?>         
	<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 } ?>
