Update Quantity through an editior or text box
<p>EDIT: Basically want to change the current method of adding more than one of the same product from adding them individually to the cart to when one has been added you can just input how many you want.</p>

<p>Hi guys so currently in my system the quantity of an item added to the cart is updated by the user clicking to continue shopping and going back and selecting a new item each time they wish to add it. I would like for this to be done through either an editor or text box so they can select the quantity they want without having to go back to view the product like 3 times.</p>

<p>Add method (Shopping Cart Controller)</p>

<pre><code>public ActionResult AddToCart(int id)
        {
            var addedProduct = db.Products.Single(product =&gt; product.ID == id);

            var cart = ShoppingCart.GetCart(this.HttpContext);

            cart.AddToCart(addedProduct);

            return RedirectToAction("Index");
        }
</code></pre>

<p>Add method (Shopping Cart Model)</p>

<pre><code>public void AddToCart(Product product)
        {
            var cartItem = db.Carts.SingleOrDefault(c =&gt; c.CartId == ShoppingCartId &amp;&amp; c.ProductId == product.ID);

            if (cartItem == null)
            {
                cartItem = new Cart
                {
                    ProductId = product.ID,
                    CartId = ShoppingCartId,
                    Count = 1,
                    DateCreated = DateTime.Now
                };
                db.Carts.Add(cartItem);
            }
            else
            {
                cartItem.Count++;
            }

            db.SaveChanges();
        }
</code></pre>

<p>shopping cart view model</p>

<pre><code> public class ShoppingCartViewModel
    {
        public List&lt;Cart&gt; CartItems { get; set; }
        public decimal CartTotal { get; set; }
    }
}
</code></pre>

<p>Shopping Cart View
    @{
        ViewBag.Title = "Store Checkout";
        CultureInfo us = new CultureInfo("en-GB");
    }</p>

<pre><code>&lt;h3 class="text-center"&gt;
    &lt;span&gt;&lt;img src="~/Content/Images/shoping_cart.png" /&gt;Your shopping cart:&lt;/span&gt;
&lt;/h3&gt;

&lt;div id="update-message" class="text-info"&gt;
&lt;/div&gt;
@if (Model.CartItems.Count == 0)
{
    &lt;a class="btn-danger" href="~/Products/Index"&gt;Your shopping cart is empty, continue shopping---&gt;&lt;/a&gt;
}
else
{
    &lt;table class="table-responsive table-bordered table-striped"&gt;
        &lt;tr&gt;
            &lt;th&gt;
                Product Name
            &lt;/th&gt;
            &lt;th&gt;
                Price (each)
            &lt;/th&gt;
            &lt;th&gt;
                Quantity
            &lt;/th&gt;
            &lt;th&gt;Sub-total&lt;/th&gt;
            &lt;th&gt;&lt;/th&gt;
        &lt;/tr&gt;
        @foreach (var item in Model.CartItems)
        {
            &lt;tr id="row-@item.ProductId"&gt;
                &lt;td&gt;
                    @Html.ActionLink(item.Product.Name, "Details", "Products", new { id = item.ProductId }, null)
                &lt;/td&gt;
                &lt;td&gt;
                    @item.Product.Price
                &lt;/td&gt;
                &lt;td id="item-count-@item.ProductId"&gt;
                    @item.Count
                &lt;/td&gt;
                &lt;td&gt;
                    @((item.Product.Price * item.Count).ToString("c", us))
                &lt;/td&gt;
                &lt;td&gt;
                    &lt;a href="" class="RemoveLink" data-id="@item.ProductId"&gt;
                        Remove from cart
                    &lt;/a&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
        }
        &lt;tr&gt;
            &lt;td&gt;
                Total
            &lt;/td&gt;
            &lt;td&gt;&lt;/td&gt;
            &lt;td&gt;&lt;/td&gt;
            &lt;td id="cart-total" class="text-success"&gt;
                &lt;b&gt;@Model.CartTotal.ToString("C", us)&lt;/b&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;

    &lt;p class="button"&gt;
        &lt;a&gt;@Html.ActionLink("Continue Shopping", "Index", "Products")&lt;/a&gt;
    &lt;/p&gt;
    &lt;p class="button"&gt;
        @Html.ActionLink("Click and Collect Order&gt;&gt; ", "AddressAndPayment", "Checkout")  @Html.ActionLink("Checkout With Braintree&gt;&gt; ", "AddressAndPaymentBraintree", "Checkout")
    &lt;/p&gt;
}
</code></pre>

<p>Any Help to solving this would be much appreciated.</p>