Skip to content

Commit 650e17c

Browse files
committed
Merge branch 'master' of github.com:woothemes/woocommerce
Conflicts: readme.txt
2 parents b66e6d4 + 40f8ed5 commit 650e17c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

includes/class-wc-coupon.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,8 @@ public function get_discount_amount( $discounting_amount, $cart_item = null, $si
623623
$discount_percent = 0;
624624

625625
if ( WC()->cart->subtotal_ex_tax ) {
626-
$discount_percent = ( $cart_item['data']->get_price_excluding_tax() * $cart_item['quantity'] ) / WC()->cart->subtotal_ex_tax;
626+
// Uses price inc tax if prices include tax to work around https://github.com/woothemes/woocommerce/issues/7669
627+
$discount_percent = ( $cart_item['data']->get_price() * $cart_item['quantity'] ) / ( wc_prices_include_tax() ? WC()->cart->subtotal : WC()->cart->subtotal_ex_tax );
627628
}
628629

629630
$discount = min( ( $this->coupon_amount * $discount_percent ) / $cart_item['quantity'], $discounting_amount );

readme.txt

+1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
156156
* Tweak - Improved message when variation attributes are missing.
157157
* Tweak - Allow wc_attribute_label to support product-level attribute names.
158158
* Tweak - Added the option to not round the line total.
159+
* Tweak - Improved coupon percent calculation for fixed discounts.
159160
* Dev - API - reports/sales now also returns total refunds.
160161

161162
= 2.3.5 - 20/02/2015 =

0 commit comments

Comments
 (0)