Revert "Merge branch 'cleanmaster' into modules"

This reverts commit d0ff5260f7, reversing
changes made to 67d0101dbe.
This commit is contained in:
Etienne Roudeix
2013-12-20 11:16:42 +01:00
parent d0ff5260f7
commit b3ac365b45
332 changed files with 3575 additions and 4787 deletions

View File

@@ -82,8 +82,15 @@ class CouponManager
if (count($this->coupons) > 0) {
$couponsKept = $this->sortCoupons($this->coupons);
$isRemovingPostage = $this->isCouponRemovingPostage($couponsKept);
$discount = $this->getEffect($couponsKept);
if ($isRemovingPostage) {
$postage = $this->facade->getCheckoutPostagePrice();
$discount += $postage;
}
// Just In Case test
$checkoutTotalPrice = $this->facade->getCartTotalPrice();
if ($discount >= $checkoutTotalPrice) {
@@ -96,24 +103,23 @@ class CouponManager
/**
* Check if there is a Coupon removing Postage
*
* @param array $couponsKept Array of CouponInterface sorted
*
* @return bool
*/
public function isCouponRemovingPostage()
protected function isCouponRemovingPostage(array $couponsKept)
{
if (count($this->coupons) == 0) {
return false;
}
$couponsKept = $this->sortCoupons($this->coupons);
$isRemovingPostage = false;
/** @var CouponInterface $coupon */
foreach ($couponsKept as $coupon) {
if ($coupon->isRemovingPostage()) {
return true;
$isRemovingPostage = true;
}
}
return false;
return $isRemovingPostage;
}
/**