Upsells should not include the current product

This commit is contained in:
Dalton Rooney 2012-12-27 10:26:31 -05:00
parent 4817c324c2
commit 1c01ad3f1c
1 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,8 @@ $args = array(
'no_found_rows' => 1,
'posts_per_page' => $posts_per_page,
'orderby' => $orderby,
'post__in' => $upsells
'post__in' => $upsells,
'post__not_in' => array($product->id)
);
$products = new WP_Query( $args );
@ -48,4 +49,4 @@ if ( $products->have_posts() ) : ?>
<?php endif;
wp_reset_postdata();
wp_reset_postdata();