<?php global $qaleb;?>
<?php if($qaleb['shop-ac']=='1'){?>
<div class="celer"></div> 
<section class="ap_main">
<div class="container inn">
<div class="boxx">
<div class="tit"><h4><span><?php echo $qaleb['shop-title']; ?></span></h4></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(); ?>
<div class="item-shop clearfix">
<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>
<div class="cast">
<?php woocommerce_template_loop_price() ?> تومان
<div class="basket"><a href="<?php the_permalink(); ?>" title="افزودن به سبد خرید" rel="tooltip" ><i class="fa fa-shopping-basket"></i></a></div>
</div>
</div>
 <?php endwhile; endif;  wp_reset_query(); ?>
</div></div>
</section>
<?php } ?>