From a08ed36f2366ecd0cbf20fcf77c04f6e6ddb5745 Mon Sep 17 00:00:00 2001 From: Brent Shepherd Date: Thu, 24 May 2012 15:58:19 +1000 Subject: [PATCH] Adding cart_contents_total filter. --- classes/class-wc-cart.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/class-wc-cart.php b/classes/class-wc-cart.php index 7e882f0d1c5..941d61aa09a 100644 --- a/classes/class-wc-cart.php +++ b/classes/class-wc-cart.php @@ -1661,10 +1661,12 @@ class WC_Cart { */ function get_cart_total() { if ( ! $this->prices_include_tax ) { - return woocommerce_price( $this->cart_contents_total ); + $cart_contents_total = woocommerce_price( $this->cart_contents_total ); } else { - return woocommerce_price( $this->cart_contents_total + $this->tax_total ); + $cart_contents_total = woocommerce_price( $this->cart_contents_total + $this->tax_total ); } + + return apply_filters( 'woocommerce_cart_contents_total', $cart_contents_total ); } /**