public static function LicenseMultiplesCartEventSubscriber::getSubscribedEvents in Commerce License 8.2
File
- src/
EventSubscriber/ LicenseMultiplesCartEventSubscriber.php, line 26
Class
- LicenseMultiplesCartEventSubscriber
- Ensures only 1 of each license may be added to the cart.
Namespace
Drupal\commerce_license\EventSubscriberCode
public static function getSubscribedEvents() {
$events = [
// These need to run before \Drupal\commerce_cart\EventSubscriber\CartEventSubscriber
// Also expects the patch at https://www.drupal.org/project/commerce/issues/2930979
// so that CartEventSubscriber doesn't show its message when we prevent
// an item from being added.
CartEvents::CART_ENTITY_ADD => [
'onCartEntityAdd',
100,
],
CartEvents::CART_ORDER_ITEM_UPDATE => [
'onCartItemUpdate',
100,
],
];
return $events;
}