woocommerce/templates/loop-shop.php

57 lines
1.5 KiB
PHP
Raw Normal View History

2011-08-09 15:16:18 +00:00
<?php
global $woocommerce_loop;
2011-08-09 15:16:18 +00:00
$woocommerce_loop['loop'] = 0;
$woocommerce_loop['show_products'] = true;
2011-08-09 15:16:18 +00:00
if (!isset($woocommerce_loop['columns']) || !$woocommerce_loop['columns']) $woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);
2011-08-09 15:16:18 +00:00
?>
2011-08-09 15:16:18 +00:00
<?php do_action('woocommerce_before_shop_loop'); ?>
2011-10-07 19:27:10 +00:00
<ul class="products">
<?php
2011-08-09 15:16:18 +00:00
do_action('woocommerce_before_shop_loop_products');
if ($woocommerce_loop['show_products'] && have_posts()) : while (have_posts()) : the_post();
$_product = &new woocommerce_product( $post->ID );
2011-08-09 15:16:18 +00:00
if (!$_product->is_visible()) continue;
2011-08-09 15:16:18 +00:00
$woocommerce_loop['loop']++;
?>
<li class="product <?php if ($woocommerce_loop['loop']%$woocommerce_loop['columns']==0) echo 'last'; if (($woocommerce_loop['loop']-1)%$woocommerce_loop['columns']==0) echo 'first'; ?>">
2011-08-09 15:16:18 +00:00
<?php do_action('woocommerce_before_shop_loop_item'); ?>
2011-08-09 15:16:18 +00:00
<a href="<?php the_permalink(); ?>">
<?php do_action('woocommerce_before_shop_loop_item_title', $post, $_product); ?>
<h3><?php the_title(); ?></h3>
<?php do_action('woocommerce_after_shop_loop_item_title', $post, $_product); ?>
2011-08-09 15:16:18 +00:00
</a>
<?php do_action('woocommerce_after_shop_loop_item', $post, $_product); ?>
</li><?php
2011-08-09 15:16:18 +00:00
endwhile; endif;
2011-08-09 15:16:18 +00:00
if ($woocommerce_loop['loop']==0) echo '<li class="info">'.__('No products found which match your selection.', 'woothemes').'</li>';
2011-08-09 15:16:18 +00:00
?>
2011-08-09 15:16:18 +00:00
</ul>
<div class="clear"></div>
2011-08-09 15:16:18 +00:00
<?php do_action('woocommerce_after_shop_loop'); ?>