From f2150e7c7c4ddf408eebe56e030cd59284800115 Mon Sep 17 00:00:00 2001 From: Brent Shepherd Date: Mon, 24 Sep 2012 12:54:41 +1000 Subject: [PATCH 1/2] Filter WC_Cart->needs_payment() value --- classes/class-wc-cart.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/class-wc-cart.php b/classes/class-wc-cart.php index a562e8e5278..ec1bc1f9719 100644 --- a/classes/class-wc-cart.php +++ b/classes/class-wc-cart.php @@ -1436,7 +1436,8 @@ class WC_Cart { * @return bool */ function needs_payment() { - if ( $this->total > 0 ) return true; else return false; + $needs_payment = ( $this->total > 0 ) ? true : false; + return apply_filters( 'woocommerce_cart_needs_payment', $needs_payment, $this ); } /*-----------------------------------------------------------------------------------*/ From 137b01c74c280e2768a9b05c4214f86a403c0a25 Mon Sep 17 00:00:00 2001 From: Brent Shepherd Date: Mon, 24 Sep 2012 12:55:57 +1000 Subject: [PATCH 2/2] Show taxes if there are formatted taxes The cart only checks if an order has tax when deciding to display taxes. Subscriptions 1.2+ stores recurring taxes separately, so when an order has a free trial period and no sign-up fee, order tax will be 0 but the recurring taxes should still be displayed. --- templates/checkout/review-order.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/checkout/review-order.php b/templates/checkout/review-order.php index fc82cec9502..6dec6898c07 100755 --- a/templates/checkout/review-order.php +++ b/templates/checkout/review-order.php @@ -121,9 +121,9 @@ $available_methods = $woocommerce->shipping->get_available_shipping_methods(); cart->get_cart_tax()) : + $taxes = $woocommerce->cart->get_formatted_taxes(); - $taxes = $woocommerce->cart->get_formatted_taxes(); + if ( $woocommerce->cart->get_cart_tax() || ! empty( $taxes ) ) : if (sizeof($taxes)>0) :