Exemplo n.º 1
0
 /**
  * Empty cart.
  *
  * This method dispatches all Cart Load events
  *
  * @param CartInterface $cart Cart
  *
  * @return $this Self object
  */
 public function emptyLines(CartInterface $cart)
 {
     $cart->getCartLines()->map(function (CartLineInterface $cartLine) use($cart) {
         $this->silentRemoveLine($cart, $cartLine);
     });
     $this->cartEventDispatcher->dispatchCartOnEmptyEvent($cart);
     $this->cartEventDispatcher->dispatchCartLoadEvents($cart);
     return $this;
 }