From 24589a7142c9fdf3a85705e14ebe87381fc346fb Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Wed, 30 Jul 2014 16:57:42 +0200 Subject: [PATCH 1/2] Updated order discount when clearing order coupons --- core/lib/Thelia/Action/Coupon.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/lib/Thelia/Action/Coupon.php b/core/lib/Thelia/Action/Coupon.php index 4dc708394..27a882f5c 100644 --- a/core/lib/Thelia/Action/Coupon.php +++ b/core/lib/Thelia/Action/Coupon.php @@ -118,6 +118,8 @@ class Coupon extends BaseAction implements EventSubscriberInterface $this->couponManager->clear(); $this->request->getSession()->setConsumedCoupons(array()); + + $this->updateOrderDiscount(null); } /** From 833cebb248a0fd2e4ee2c39510b87749309f9835 Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Wed, 30 Jul 2014 16:57:58 +0200 Subject: [PATCH 2/2] Using taxed cart total instead of untaxed price --- .../lib/Thelia/Condition/Implementation/MatchForTotalAmount.php | 2 +- .../Tests/Condition/Implementation/MatchForTotalAmountTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php b/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php index 225157b38..d178b6298 100644 --- a/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php +++ b/core/lib/Thelia/Condition/Implementation/MatchForTotalAmount.php @@ -93,7 +93,7 @@ class MatchForTotalAmount extends ConditionAbstract public function isMatching() { $condition1 = $this->conditionValidator->variableOpComparison( - $this->facade->getCartTotalPrice(), + $this->facade->getCartTotalTaxPrice(), $this->operators[self::CART_TOTAL], $this->values[self::CART_TOTAL] ); diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php index fa599a866..f63cc5142 100644 --- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php +++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForTotalAmountTest.php @@ -48,7 +48,7 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase ->getMock(); $stubFacade->expects($this->any()) - ->method('getCartTotalPrice') + ->method('getCartTotalTaxPrice') ->will($this->returnValue($cartTotalPrice)); $stubFacade->expects($this->any())