src/Sulu/Bundle/Sales/OrderBundle/Cart/CartManager.php
public function updateItem($itemId, $data, $user = null, $locale = null)
    {
        $cart = $this->getUserCart($user, $locale);
        $userId = $user ? $user->getId() : null;

        $this->validateOrCreateAddresses($cart, $user);

        $item = $this->orderManager->getOrderItemById($itemId, $cart->getEntity());

        $this->orderManager->updateItem($item, $data, $locale, $userId);

        $this->removeOrderAddressIfContactAddressIdIsEqualTo(
            $item,
            $cart->getDeliveryAddress()->getContactAddress()->getId()
        );

        $this->orderManager->updateApiEntity($cart, $locale);

        return $cart;
    }
public function updateItem($itemId, $data, $user = null, $locale = null)
    {
        $cart = $this->getUserCart($user, $locale);
        $userId = $user ? $user->getId() : null;

        $this->validateOrCreateAddresses($cart, $user);

        $item = $this->orderManager->getOrderItemById($itemId, $cart->getEntity());

        $this->orderManager->updateItem($item, $data, $locale, $userId);

        $this->removeOrderAddressIfContactAddressIdIsEqualTo(
            $item,
            $cart->getDeliveryAddress()->getContactAddress()->getId()
        );

        $this->orderManager->updateApiEntity($cart, $locale);

        return $cart;
    }
public function updateItem ( $ itemId , $ data , $ user = null , $ locale = null ) { $ cart = $ this -> getUserCart ( $ user , $ locale ) ; $ userId = $ user ? $ user -> getId ( ) : null ; $ this -> validateOrCreateAddresses ( $ cart , $ user ) ; $ item = $ this -> orderManager -> getOrderItemById ( $ itemId , $ cart -> getEntity ( ) ) ; $ this -> orderManager -> updateItem ( $ item , $ data , $ locale , $ userId ) ; $ this -> removeOrderAddressIfContactAddressIdIsEqualTo ( $ item , $ cart -> getDeliveryAddress ( ) -> getContactAddress ( ) -> getId ( ) ) ; $ this -> orderManager -> updateApiEntity ( $ cart , $ locale ) ; return $ cart ; }
Update item data

@param int $itemId
@param array $data
@param null|UserInterface $user
@param null|string $locale

@throws ItemNotFoundException

@return null|Order
Update item data