Skip to content
Code-Schnipsel Gruppen Projekte

feat: show errors direclty under the input

Zusammengeführt Michael Danielczok schlägt vor, 20-feat-ux-error-handling in next-2.x zu mergen.
3 Dateien
+ 2
58
Änderungen vergleichen
  • Nebeneinander
  • In der Reihe
Dateien
3
+ 0
40
@@ -32,9 +32,7 @@ function ($code, $orderHash) {
} catch (QUI\ERP\Coupons\CouponCodeException $Exception) {
QUI\System\Log::writeDebugException($Exception);
// QUI::getMessagesHandler()->addError($Exception->getMessage());
throw $Exception;
// return false;
} catch (Exception $Exception) {
QUI\System\Log::writeException($Exception);
@@ -42,15 +40,6 @@ function ($code, $orderHash) {
'quiqqer/coupons',
'message.ajax.general_error'
]);
// QUI::getMessagesHandler()->addError(
// QUI::getLocale()->get(
// 'quiqqer/coupons',
// 'message.ajax.general_error'
// )
// );
// return false;
}
$Order = QUI\ERP\Order\Handler::getInstance()->getOrderByHash($orderHash);
@@ -67,15 +56,6 @@ function ($code, $orderHash) {
'quiqqer/coupons',
'exception.CouponCode.discounts_invalid'
]);
// QUI::getMessagesHandler()->addError(
// QUI::getLocale()->get(
// 'quiqqer/coupons',
// 'exception.CouponCode.discounts_invalid'
// )
// );
//
// return false;
}
if ($Discount->getAttribute('scope') === QUI\ERP\Discount\Handler::DISCOUNT_SCOPE_GRAND_TOTAL) {
@@ -84,15 +64,6 @@ function ($code, $orderHash) {
'quiqqer/coupons',
'exception.CouponCode.discounts_invalid'
]);
// QUI::getMessagesHandler()->addError(
// QUI::getLocale()->get(
// 'quiqqer/coupons',
// 'exception.CouponCode.discounts_invalid'
// )
// );
//
// return false;
}
continue;
@@ -103,15 +74,6 @@ function ($code, $orderHash) {
'quiqqer/coupons',
'exception.CouponCode.discounts_invalid'
]);
// QUI::getMessagesHandler()->addError(
// QUI::getLocale()->get(
// 'quiqqer/coupons',
// 'exception.CouponCode.discounts_invalid'
// )
// );
//
// return false;
}
}
@@ -133,8 +95,6 @@ function ($code, $orderHash) {
if ($Order instanceof QUI\ERP\Order\OrderInProcess) {
$CouponCode->addToOrder($Order);
}
// return true;
},
['code', 'orderHash']
);