Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Updating the cart

$
0
0

Hi,

 When i update the qunatity of a line item, the following error occurs  on saving the cart and it occurs strangely for only one product. This product is provided with valid quantity and price but still this error occurs:

"Invalid order group total calculation"

The following code is used for updating the cart:

var lineItem = GetLineItem(cartDetail.Code);
if (lineItem != null)
{
status.Success = true;

if (cartDetail.Quantity > 0)
{
lineItem.Quantity = cartDetail.Quantity;
}
else
{
PurchaseOrderManager.RemoveLineItemFromOrder(Cart as OrderGroup, lineItem.LineItemId);
}
lineItem.SetCustomField(MetaFieldNames.LineComment, cartDetail.LineComment);
}
else
{
status.WarningMessage = "Can't find product with code " + cartDetail.Code;
updateActionStatus.Success = false;
}
updateActionStatus.CartActionStatuses.Add(status);

orderRepository.Save(cart);

Please help in resolving this issue.

Thanks in Advance.


Viewing all articles
Browse latest Browse all 9076

Trending Articles