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

25 lines
495 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">
2012-01-05 11:31:22 +00:00
<h2><?php _e('You may also like&hellip;', 'woocommerce') ?></h2>
2011-12-12 12:28:07 +00:00
<?php
$args = array(
'post_type' => 'product',
'ignore_sticky_posts' => 1,
'posts_per_page' => 4,
2012-03-14 11:41:25 +00:00
'no_found_rows' => 1,
2011-12-12 12:28:07 +00:00
'orderby' => 'rand',
'post__in' => $upsells
);
query_posts($args);
woocommerce_get_template_part( 'loop', 'shop' );
wp_reset_query();
?>
</div>