class CommerceCartFlyoutServiceProvider in Commerce Cart Flyout 8
Replaces the add to cart message.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\commerce_cart_flyout\CommerceCartFlyoutServiceProvider
Expanded class hierarchy of CommerceCartFlyoutServiceProvider
File
- src/
CommerceCartFlyoutServiceProvider.php, line 13
Namespace
Drupal\commerce_cart_flyoutView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CommerceCartFlyoutServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceProviderBase:: |
|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |