public function CartSubscriber::onCartEntityAdd in Commerce Shipping 8.2
Force repack/rates recalculation when an order item is added to the cart.
Parameters
\Drupal\commerce_cart\Event\CartEntityAddEvent $event: The cart event.
File
- src/
EventSubscriber/ CartSubscriber.php, line 71
Class
Namespace
Drupal\commerce_shipping\EventSubscriberCode
public function onCartEntityAdd(CartEntityAddEvent $event) {
$cart = $event
->getCart();
if ($this->shippingOrderManager
->hasShipments($cart)) {
$cart
->setData(ShippingOrderManagerInterface::FORCE_REFRESH, TRUE);
}
}