Redesigned account, checkout Added stock management design elements
This commit is contained in:
@@ -54,7 +54,19 @@
|
||||
{
|
||||
<span class="badge badge-physical">Physical Book</span>
|
||||
}
|
||||
<span class="badge badge-ebook">In Stock</span>
|
||||
|
||||
@if (StockCount <= 0)
|
||||
{
|
||||
<span class="badge bg-danger text-white border-0">Out of Stock</span>
|
||||
}
|
||||
else if (StockCount <= 3)
|
||||
{
|
||||
<span class="badge bg-warning text-dark border-0">Only @StockCount Left</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="badge badge-ebook">In Stock (@StockCount available)</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -89,14 +101,24 @@
|
||||
<div class="product-price">R @LivePrice.ToString("N2")</div>
|
||||
|
||||
<div class="purchase-actions">
|
||||
<div class="quantity-picker">
|
||||
<button @onclick="DecreaseQty" class="qty-btn">-</button>
|
||||
<span class="qty-val">@Quantity</span>
|
||||
<button @onclick="IncreaseQty" class="qty-btn">+</button>
|
||||
<div class="quantity-picker @(StockCount <= 0 ? "opacity-50 pointer-events-none" : "")">
|
||||
<button @onclick="DecreaseQty" class="qty-btn" disabled="@(StockCount <= 0 || Quantity <= 1)">-</button>
|
||||
<span class="qty-val">@(StockCount <= 0 ? 0 : Quantity)</span>
|
||||
<button @onclick="IncreaseQty" class="qty-btn" disabled="@(StockCount <= 0 || Quantity >= StockCount)">+</button>
|
||||
</div>
|
||||
<button class="btn-add-to-cart" @onclick="HandleAddToCart">
|
||||
Add to Cart
|
||||
</button>
|
||||
|
||||
@if (StockCount > 0)
|
||||
{
|
||||
<button class="btn-add-to-cart" @onclick="HandleAddToCart">
|
||||
Add to Cart
|
||||
</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn-add-to-cart bg-secondary text-white-50 cursor-not-allowed" disabled>
|
||||
Sold Out
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
|
||||
<hr class="divider" />
|
||||
|
||||
Reference in New Issue
Block a user