How can I get the total number of units in the shopping card altogether, rather than just the amount of items? I'm having real trouble on this and tried multiple methods, including making my own code behind.
Example:
int totalUnits = 0;
foreach (ShoppingCartItemInfo item in sc.CartItems)
{
totalUnits += item.CartItemUnits;
}
this.TotalPriceTitleText = totalUnits.ToString();
lblTotalPriceTitle.Text = this.TotalPriceTitleText.TrimEnd() + totalUnits.ToString();
Can anyone that knows how to do this fill me in on exactly what needs to be done?