When fetching the shopping cart using CartModuleController.GetCartById the totals are set to zero. This endpoint loads the cart using CartResponseGroup.Full. However, the class ShoppingCartService seems to have a bug in the ProcessModel method:
protected override ShoppingCart ProcessModel(string responseGroup, ShoppingCartEntity entity, ShoppingCart model)
{
//Calculate totals only for full responseGroup
if (responseGroup == null)
{
_totalsCalculator.CalculateTotals(model);
}
model.ReduceDetails(responseGroup);
return model;
}
I guess the code should look like this:
protected override ShoppingCart ProcessModel(string responseGroup, ShoppingCartEntity entity, ShoppingCart model)
{
//Calculate totals only for full responseGroup
if (responseGroup == null || responseGroup == CartResponseGroup.Full.ToString())
{
_totalsCalculator.CalculateTotals(model);
}
model.ReduceDetails(responseGroup);
return model;
}
I assume that not specified response group (null) means Full.
When fetching the shopping cart using
CartModuleController.GetCartById
the totals are set to zero. This endpoint loads the cart usingCartResponseGroup.Full
. However, the classShoppingCartService
seems to have a bug in theProcessModel
method:I guess the code should look like this:
I assume that not specified response group (null) means Full.