woocommerce/templates/cart/cross-sells.php

26 lines
590 B
PHP
Raw Normal View History

2011-12-12 12:28:07 +00:00
<?php
/**
* Cross-sells
*/
global $woocommerce_loop, $woocommerce, $product;
$crosssells = $woocommerce->cart->get_cross_sells();
if (sizeof($crosssells)==0) return;
$woocommerce_loop['columns'] = 2;
?>
<div class="cross-sells">
2012-01-05 11:31:22 +00:00
<h2><?php _e('You may be interested in&hellip;', 'woocommerce') ?></h2>
2011-12-12 12:28:07 +00:00
<?php
$args = array(
'post_type' => 'product',
'ignore_sticky_posts' => 1,
'posts_per_page' => 2,
2012-03-14 11:41:25 +00:00
'no_found_rows' => 1,
2011-12-12 12:28:07 +00:00
'orderby' => 'rand',
'post__in' => $crosssells
);
query_posts($args);
woocommerce_get_template_part( 'loop', 'shop' );
wp_reset_query();
?>
</div>