/** * Method subscribed to CartLoad event * * Checks if all Coupons applied to current cart are still valid. * If are not, they will be deleted from the Cart and new Event typeof * CartCouponOnRejected will be dispatched * * @param CartOnLoadEvent $event Event */ public function refreshCartCoupons(CartOnLoadEvent $event) { $this->cartCouponValidator->validateCartCoupons($event->getCart()); }
/** * Check if cart meets basic requirements for a coupon. * * @param CartCouponOnCheckEvent $event * * @throws AbstractCouponException */ public function validateCoupon(CartCouponOnCheckEvent $event) { $this->cartCouponValidator->validateCoupon($event->getCart(), $event->getCoupon()); }