protected function duplicateCart(EventDispatcherInterface $dispatcher, CartModel $cart, CustomerModel $customer = null)
    {
        $newCart = $cart->duplicate(
            $this->generateCartCookieIdentifier(),
            $customer,
            $this->getSession()->getCurrency(),
            $dispatcher
        );

        $cartEvent = new CartDuplicationEvent($newCart, $cart);
        $dispatcher->dispatch(TheliaEvents::CART_DUPLICATE, $cartEvent);

        return $cartEvent->getDuplicatedCart();
    }
protected function duplicateCart(EventDispatcherInterface $dispatcher, CartModel $cart, CustomerModel $customer = null)
    {
        $newCart = $cart->duplicate(
            $this->generateCartCookieIdentifier(),
            $customer,
            $this->getSession()->getCurrency(),
            $dispatcher
        );

        $cartEvent = new CartDuplicationEvent($newCart, $cart);
        $dispatcher->dispatch(TheliaEvents::CART_DUPLICATE, $cartEvent);

        return $cartEvent->getDuplicatedCart();
    }
protected function duplicateCart ( EventDispatcherInterface $ dispatcher , CartModel $ cart , CustomerModel $ customer = null ) { $ newCart = $ cart -> duplicate ( $ this -> generateCartCookieIdentifier ( ) , $ customer , $ this -> getSession ( ) -> getCurrency ( ) , $ dispatcher ) ; $ cartEvent = new CartDuplicationEvent ( $ newCart , $ cart ) ; $ dispatcher -> dispatch ( TheliaEvents :: CART_DUPLICATE , $ cartEvent ) ; return $ cartEvent -> getDuplicatedCart ( ) ; }
Duplicate an existing Cart. If a customer ID is provided the created cart will be attached to this customer.

@param EventDispatcherInterface $dispatcher
@param CartModel $cart
@param CustomerModel $customer
@return CartModel
Duplicate an existing Cart . If a customer ID is provided the created cart will be attached to this customer .