Ejemplo n.º 1
0
 public function testGetItemById()
 {
     $cart1 = $this->setupCart();
     $cartItem1 = $cart1->getCartItems()[0];
     $cartItem = $this->cartRepository->getItemById($cartItem1->getId());
     $this->assertEntitiesEqual($cartItem1, $cartItem);
 }
Ejemplo n.º 2
0
 /**
  * @param UuidInterface $cartItemId
  * @throws EntityNotFoundException
  */
 public function deleteItem(UuidInterface $cartItemId)
 {
     $cartItem = $this->cartRepository->getItemById($cartItemId);
     $cart = $cartItem->getCart();
     $cart->setShipmentRate(null);
     $cart->deleteCartItem($cartItem);
     $this->cartRepository->update($cart);
 }