We are using 7/18/2019 AbleCommerce-9.0.0-b5588-WAP.zip for the beta site and it still doesn't work.
We are seeing a problem with the ability to update quantity in the minibasket control when more than one item exists in the customer’s cart. Under the condition we see, the quantity on the first item in the minibasket can be update, but none of the additional products can be.
I’ve captured a Fiddler trace of the request, which shows data for both basket items being passed to the CheckoutController:
POST
http://66.192.86.141/Che...ketItemQuantity?Length=8 HTTP/1.1
Host: 66.192.86.141
Connection: keep-alive
Content-Length: 150
Accept: */*
DNT: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3861.0 Safari/537.36 Edg/77.0.230.2
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin:
http://66.192.86.141Referer:
http://66.192.86.141/Pro...FtbWVyLS00MzU4LmFzcHg%3DAccept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: _ga=GA1.1.477916954.1560969359; AC9.SESSIONID=01di5zognoeuqltv5slrd2xv; __RequestVerificationToken=qZ8SNZoflbN_5ATgU6JOY0xYnRRXgC4EepXYBYIcDuUHWqB2yuR_QyK5NJNE3Y_7b31FNU8f9JsxND7jMQr_0zBevKE_-6nP8EvuvWrxyhs1; UserName=; AC9.ASPXAUTH=E1EEC14F996C521949BFB09DDCCBECFD7F48C49575F9A61D1509BDF409ECD0B31358ADCB6D7AAF071C17201AAC5F89F90BD32DBDBF1E8B2CD6DEDF645A7E2A55947B52D48A4D8E95F477C6AEDE63B4CDED1BC05F0F80E492D5333AC81D422A2E68335C70CC1618E9D94437394A26F5A3; AC9.ASPXANONYMOUS=iCc3ZCYhoe5CUn24Ynyqy13JgAQjhTAj3Z7dmWOJA1Xis7fFr3NOLCjMmWhw6VYS6YQv_5uA4zquaIb4ruchss-424jN8Iuu9C6J8fn4042m3q0911iH_pWqiZxP82JDwO-ihI-we9isF5ks6FLQBQ2; _gid=GA1.1.154318835.1565612349
basketItemId=4273360&Quantity=4&item.Id=4273360&basketItemId=4273368&Quantity=4&item.Id=4273368&IsMiniCheckoutButton=0&X-Requested-With=XMLHttpRequest
Also, we’ve examined the controller code for the method being called. The source is pulled from the AbleCommerce AbleCommerce-9.0.0-b5588-WAP codebase, which our test site is running on:
#region UPDATE BASKET ITEM QUANTITY
// GET: Checkout/_UpdateBasketItemQuantity
public ActionResult _UpdateBasketItemQuantity(int basketItemId, short quantity)
{
var basket = AbleContext.Current.User.Basket;
int itemIndex = basket.Items.IndexOf(basketItemId);
if ((itemIndex > -1))
{
BasketItem item = basket.Items[itemIndex];
if (quantity > System.Int16.MaxValue)
{
item.Quantity = System.Int16.MaxValue;
}
else
{
item.Quantity = quantity;
}
// Update for Minimum Maximum quantity of product
if (item.Quantity < item.Product.MinQuantity)
{
item.Quantity = item.Product.MinQuantity;
}
else if ((item.Product.MaxQuantity > 0) && (item.Quantity > item.Product.MaxQuantity))
{
item.Quantity = item.Product.MaxQuantity;
}
AbleContext.Resolve<IBasketItemRepository>().Save(item);
}
// check if checkout is requested
var isMiniCheckout = Request.Form["IsMiniCheckoutButton"];
var isMiniDropdownCheckout = Request.Form["IsMiniDropdownCheckoutButton"];
if ((!string.IsNullOrEmpty(isMiniCheckout) && isMiniCheckout == "1") || (!string.IsNullOrEmpty(isMiniDropdownCheckout) && isMiniDropdownCheckout == "1"))
{
IBasketService service = AbleContext.Resolve<IBasketService>();
ValidationResponse response = service.Validate(basket);
if (!response.Success)
{
Session["BasketMessage"] = response.WarningMessages;
return JavaScript("window.location = '" + Url.Content(NavigationHelper.GetBasketUrl()) + "'");
}
// TODO: Update the method name GetCheckoutUrl to GetCheckoutActionName
return JavaScript("window.location = '" + Url.Action(AbleCommerce.Code.NavigationHelper.GetCheckoutUrl(), "Checkout") + "'");
}
return RedirectToAction("_MiniBasket");
}
#endregion
As I’ve highlighted in the method signature, the “_UpdateBasketItemQuantity” Is only looking for a single integer and a short for quantity. The subsequent code seems to confirm this, and I believe the second or greater basketitem id and quantity will be ignored.
Is this issue being addressed?