Skip to content
Code-Schnipsel Gruppen Projekte
Commit 8af4a8f6 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

fix: #10

Übergeordneter 3b243ce9
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -45,6 +45,7 @@ function ($code, $orderHash) {
$calculations = $Order->getArticles()->getCalculations();
$subSum = $calculations['subSum'];
$sum = $calculations['sum'];
$discounts = $CouponCode->getDiscounts();
foreach ($discounts as $Discount) {
......@@ -59,6 +60,21 @@ function ($code, $orderHash) {
return false;
}
if ($Discount->getAttribute('scope') === QUI\ERP\Discount\Handler::DISCOUNT_SCOPE_GRAND_TOTAL) {
if (!DiscountEvents::isDiscountUsableWithPurchaseValue($Discount, $sum)) {
QUI::getMessagesHandler()->addError(
QUI::getLocale()->get(
'quiqqer/coupons',
'exception.CouponCode.discounts_invalid'
)
);
return false;
}
continue;
}
if (!DiscountEvents::isDiscountUsableWithPurchaseValue($Discount, $subSum)) {
QUI::getMessagesHandler()->addError(
QUI::getLocale()->get(
......
......@@ -252,7 +252,10 @@ public static function onQuiqqerOrderBasketToOrder(
continue;
}
if (!DiscountEvents::isDiscountUsableWithPurchaseValue($Discount, $subSum)) {
if ($Discount->getAttribute('scope') === QUI\ERP\Discount\Handler::DISCOUNT_SCOPE_GRAND_TOTAL) {
// do nothing for this scope
// since this scope requires all price factors etc, this cannot be calculated here
} elseif (!DiscountEvents::isDiscountUsableWithPurchaseValue($Discount, $subSum)) {
continue;
}
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren