You are here

class CommerceCartFlyoutServiceProvider in Commerce Cart Flyout 8

Replaces the add to cart message.

Hierarchy

Expanded class hierarchy of CommerceCartFlyoutServiceProvider

File

src/CommerceCartFlyoutServiceProvider.php, line 13

Namespace

Drupal\commerce_cart_flyout
View source
class CommerceCartFlyoutServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {

    // Replace the server side add to cart messaging.
    if ($container
      ->hasDefinition('commerce_cart.cart_subscriber')) {
      $definition = $container
        ->getDefinition('commerce_cart.cart_subscriber');
      $definition
        ->setClass(CartEventSubscriber::class)
        ->addArgument(new Reference('current_route_match'));
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommerceCartFlyoutServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceProviderBase::alter
ServiceProviderBase::register public function Registers services to the container. Overrides ServiceProviderInterface::register 1