2011-12-11 23:16:34 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Related Products
|
|
|
|
*/
|
|
|
|
|
2012-02-03 16:17:35 +00:00
|
|
|
global $product, $woocommerce_loop;
|
2011-12-11 23:16:34 +00:00
|
|
|
|
|
|
|
$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(
|
2012-02-03 16:17:35 +00:00
|
|
|
'post_type' => 'product',
|
2011-12-11 23:16:34 +00:00
|
|
|
'ignore_sticky_posts' => 1,
|
2012-02-03 16:17:35 +00:00
|
|
|
'posts_per_page' => $posts_per_page,
|
|
|
|
'orderby' => $orderby,
|
|
|
|
'post__in' => $related
|
2011-12-11 23:16:34 +00:00
|
|
|
);
|
|
|
|
$args = apply_filters('woocommerce_related_products_args', $args);
|
2012-02-03 16:17:35 +00:00
|
|
|
|
2011-12-11 23:16:34 +00:00
|
|
|
query_posts($args);
|
2012-02-03 16:17:35 +00:00
|
|
|
|
|
|
|
$woocommerce_loop['columns'] = $columns;
|
|
|
|
|
2011-12-11 23:16:34 +00:00
|
|
|
woocommerce_get_template_part( 'loop', 'shop' );
|
2012-02-03 16:17:35 +00:00
|
|
|
|
2011-12-11 23:16:34 +00:00
|
|
|
wp_reset_query();
|
|
|
|
?>
|
|
|
|
</div>
|