<section id=”recent”>
<h1>فروشگاه</h1>
<ul class=”row-fluid”>
<?php
$args = array( ‘post_type’ => ‘product’, ‘stock’ => 1, ‘posts_per_page’ => 4, ‘orderby’ =>’date’,’order’ => ‘DESC’ );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
id(); ?>” href=”<?php the_permalink(); ?>” title=”<?php the_t
<li class=”span3″>
<a id=”id-<?php the_itle(); ?>”>
<?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, ‘shop_catalog’); else echo ‘<img src=”‘.woocommerce_placeholder_img_src().’” alt=”Placeholder” width=”215px” height=”286px” />’; ?>
<h3><?php the_title(); ?></h3>
<span class=”price”><?php echo $product->get_price_html(); ?></span></a>
(); ?>
</ul><!– /row-fluid –>
</section><!– /recent –>
<?php woocommerce_template_loop_add_to_cart( $loop->post, $product ); ?>
</li><!-- /span3 -->
<?php endwhile; ?>
<?php wp_reset_query?>
کد دنمایش تعداد محصولات در سبد خرید\
<?php global $woocommerce; ?>
<a href="<?php echo $woocommerce->cart->get_cart_url(); ?>
" title="<?php _e('نمایش سبد خرید', 'woothemes'); ?>">
<?php echo sprintf(_n( '%d محصول', '%d محصول', $woocommerce->
cart->cart_contents_count, 'woothemes'), $woocommerce->cart->
cart_contents_count);?></a>