From 6898a79005934c34586916fe48152847c5e9b7b6 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 27 Jun 2016 11:42:50 +0100 Subject: [PATCH] If the cart shortcode is used on checkout, hide the totals area --- includes/wc-template-functions.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index c8ef0e257b9..410970a3dfd 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -1314,6 +1314,9 @@ if ( ! function_exists( 'woocommerce_cart_totals' ) ) { * @subpackage Cart */ function woocommerce_cart_totals() { + if ( is_checkout() ) { + return; + } wc_get_template( 'cart/cart-totals.php' ); } } @@ -1328,11 +1331,14 @@ if ( ! function_exists( 'woocommerce_cross_sell_display' ) ) { * @param string $orderby (default: 'rand') */ function woocommerce_cross_sell_display( $posts_per_page = 2, $columns = 2, $orderby = 'rand' ) { + if ( is_checkout() ) { + return; + } wc_get_template( 'cart/cross-sells.php', array( - 'posts_per_page' => $posts_per_page, - 'orderby' => $orderby, - 'columns' => $columns - ) ); + 'posts_per_page' => $posts_per_page, + 'orderby' => $orderby, + 'columns' => $columns + ) ); } }