diff --git a/events.xml b/events.xml index 40d75eddeba09ee773e4478d4e3597b257af8c21..4ce5084ffb1bbe7bb7800dfc341626c86a446679 100644 --- a/events.xml +++ b/events.xml @@ -24,4 +24,7 @@ fire="\QUI\ERP\Coupons\Events::onQuiqqerOrderBasketRemovePos" /> + <event on="onQuiqqerOrderSuccessful" fire="\QUI\ERP\Coupons\Events::removeCouponsFromSession"/> + <event on="onQuiqqer::order::orderProcessFinish" fire="\QUI\ERP\Coupons\Events::removeCouponsFromSession"/> + </events> diff --git a/src/QUI/ERP/Coupons/Events.php b/src/QUI/ERP/Coupons/Events.php index 12c599c2e3a37651342fe7115388607392b0f651..102ae37a217741c3340fae85fc58583d5934d6bd 100644 --- a/src/QUI/ERP/Coupons/Events.php +++ b/src/QUI/ERP/Coupons/Events.php @@ -393,4 +393,12 @@ protected static function addCouponToOrder($Order, $coupon) } catch (\Exception $Exception) { } } + + /** + * + */ + public static function removeCouponsFromSession() + { + QUI::getSession()->remove('quiqqer-coupons'); + } }