public function add(CartItem $cartItem)
{
$itemId = $cartItem->getId();
// if item already exists in the cart, just update the quantity,
// otherwise add it as a new item
if ($this->has($itemId)) {
$existingItem = $this->find($itemId);
$existingItem->quantity += $cartItem->quantity;
} else {
$this->items[] = $cartItem;
}
}