woocommerce/templates/single-product/up-sells.php

24 lines
469 B
PHP
Raw Normal View History

2011-12-12 12:28:07 +00:00
<?php
/**
* Up-sells
*/
global $product;
$upsells = $product->get_upsells();
if (sizeof($upsells)==0) return;
?>
<div class="upsells products">
<h2><?php _e('You may also like&hellip;', 'woothemes') ?></h2>
<?php
$args = array(
'post_type' => 'product',
'ignore_sticky_posts' => 1,
'posts_per_page' => 4,
'orderby' => 'rand',
'post__in' => $upsells
);
query_posts($args);
woocommerce_get_template_part( 'loop', 'shop' );
wp_reset_query();
?>
</div>