<?php global $qaleb;?>
<?php if($qaleb['shop-ac']=='1'){?>
<div class="shopp">
<div class="ttit">
<h3><?php echo $qaleb['shop-title']; ?></h3>
</div>
<?php
			  
			  if($qaleb['shop-content']=='1'){
				$arggs = array(
					'post_type' => 'product',
					'posts_per_page' => $qaleb['shop-count'],
				);
			  }else if($qaleb['shop-content']=='2'){
				$arggs = array(
					'post_type' => 'product',
					'posts_per_page' => $qaleb['shop-count'],
					'orderby'	=> 	'rand'
				);
			  }else if($qaleb['shop-content']=='3'){
				$arggs = array(
					'post_type' => 'product',
					'posts_per_page' => $qaleb['shop-count'],
					'tax_query' => array(
                        array(
                            'taxonomy' => 'product_cat',
                            'field'    => 'term_id',
                            'terms'    => $qaleb['shop-type-select'],
                        ),
				    ),
				);
			  }
			  
            query_posts($arggs);
            if(have_posts()) : while(have_posts()) : the_post(); ?>		
<li>
<?php if(get_post_meta($post->ID, '_sale_price', true)){ echo '<span class="onsale">حراج</span>'; } ?>	
<div class="thumbnail">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('woo'); ?>" alt="<?php the_title(); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
</div>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php woocommerce_template_loop_price() ?>
<div class="morshop"><a href="<?php the_permalink(); ?>"> خرید محصول </a></div>
</li>
 <?php endwhile; endif;  wp_reset_query(); ?>
</div>
<?php } ?>