Completed Cart page design
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-06-11 00:23:57 +02:00
parent 64e0fcba27
commit e7acb05027
7 changed files with 125 additions and 95 deletions
@@ -32,9 +32,6 @@ public partial class ProductView : ComponentBase
protected Author? CurrentAuthor { get; private set; }
private static Func<Services.ShoppingCart.Models.Cart, long, int> getCartItemQuantity = (shoppingCart, productPriceId) =>
shoppingCart.Items.FirstOrDefault(p => p.Price!.Id == productPriceId)?.Quantity ?? 1;
protected override async Task OnParametersSetAsync()
{
try
@@ -97,7 +94,7 @@ public partial class ProductView : ComponentBase
{
CartService.UpdateQuantity(CurrentPrice!.Id, 1);
Quantity = getCartItemQuantity(ShoppingCart, CurrentPrice.Id);
Quantity = CartService.GetCartItemQuantity(ShoppingCart, CurrentPrice.Id);
await CartService.SaveCartToStorageAsync();
}
@@ -108,7 +105,7 @@ public partial class ProductView : ComponentBase
{
CartService.UpdateQuantity(CurrentPrice!.Id, -1);
Quantity = getCartItemQuantity(ShoppingCart, CurrentPrice.Id);
Quantity = CartService.GetCartItemQuantity(ShoppingCart, CurrentPrice.Id);
await CartService.SaveCartToStorageAsync();
}
@@ -131,7 +128,7 @@ public partial class ProductView : ComponentBase
CartService.AddItem(CurrentPrice, CurrentProduct, CurrentAuthor!);
Quantity = getCartItemQuantity(ShoppingCart, CurrentPrice.Id);
Quantity = CartService.GetCartItemQuantity(ShoppingCart, CurrentPrice.Id);
await CartService.SaveCartToStorageAsync();
}