woocommerce/templates/single-product/related.php

26 lines
613 B
PHP
Raw Normal View History

2011-12-11 23:16:34 +00:00
<?php
/**
* Related Products
*/
global $product, $woocommerce_loop, $posts_per_page, $orderby;
$related = $product->get_related();
if (sizeof($related)==0) return;
?>
2012-01-05 11:31:22 +00:00
<div class="related products"><h2><?php _e('Related Products', 'woocommerce'); ?></h2>
2011-12-11 23:16:34 +00:00
<?php
$args = array(
'post_type' => 'product',
'ignore_sticky_posts' => 1,
'posts_per_page' => $posts_per_page,
'orderby' => $orderby,
'post__in' => $related
);
$args = apply_filters('woocommerce_related_products_args', $args);
query_posts($args);
woocommerce_get_template_part( 'loop', 'shop' );
wp_reset_query();
?>
</div>