public function CartEventSubscriber::onCartEmpty in Commerce Core 8.2
Removes coupons when the cart has been emptied.
Parameters
\Drupal\commerce_cart\Event\CartEmptyEvent $event: The cart event.
File
- modules/
promotion/ src/ EventSubscriber/ CartEventSubscriber.php, line 27
Class
Namespace
Drupal\commerce_promotion\EventSubscriberCode
public function onCartEmpty(CartEmptyEvent $event) {
$event
->getCart()
->set('coupons', []);
}