public function clearSessionCart(EventDispatcherInterface $dispatcher)
    {
        $event = new CartCreateEvent();

        $dispatcher->dispatch(TheliaEvents::CART_CREATE_NEW, $event);

        if (null === $cart = $event->getCart()) {
            throw new \LogicException(
                "Unable to get a new empty Cart."
            );
        }

        // Store the cart
        $this->setSessionCart($cart);
    }
public function clearSessionCart(EventDispatcherInterface $dispatcher)
    {
        $event = new CartCreateEvent();

        $dispatcher->dispatch(TheliaEvents::CART_CREATE_NEW, $event);

        if (null === $cart = $event->getCart()) {
            throw new \LogicException(
                "Unable to get a new empty Cart."
            );
        }

        // Store the cart
        $this->setSessionCart($cart);
    }
public function clearSessionCart ( EventDispatcherInterface $ dispatcher ) { $ event = new CartCreateEvent ( ) ; $ dispatcher -> dispatch ( TheliaEvents :: CART_CREATE_NEW , $ event ) ; if ( null === $ cart = $ event -> getCart ( ) ) { throw new \ LogicException ( "Unable to get a new empty Cart." ) ; } // Store the cart $ this -> setSessionCart ( $ cart ) ; }
Clear the current session cart, and store a new, empty one in the session.

@param EventDispatcherInterface $dispatcher
Clear the current session cart and store a new empty one in the session .