vytvoreni stranky nova objednavkja
This commit is contained in:
@@ -1,127 +1,164 @@
|
||||
@page "/kosik"
|
||||
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Web_Jarmark.Data.Models
|
||||
@using Web_Jarmark.Data
|
||||
|
||||
@inject ApplicationDbContext DbContext
|
||||
@inject IHttpContextAccessor HttpContextAccessor
|
||||
@inject PersistentComponentState ApplicationState
|
||||
|
||||
@implements IDisposable
|
||||
|
||||
<PageTitle>Můj košík | Školní jarmark</PageTitle>
|
||||
|
||||
<main class="market-shell">
|
||||
<main class="market-shell cart-page">
|
||||
|
||||
<main class="market-shell cart-page">
|
||||
<div class="cart-header">
|
||||
<div>
|
||||
<span class="cart-eyebrow">ŠKOLNÍ JARMARK</span>
|
||||
<h1>Můj košík</h1>
|
||||
<p>Vše, co sis vybral, na jednom místě.</p>
|
||||
</div>
|
||||
|
||||
<a href="/" class="cart-back-link">← Pokračovat v nákupu</a>
|
||||
<div class="cart-header">
|
||||
<div>
|
||||
<span class="cart-eyebrow">ŠKOLNÍ JARMARK</span>
|
||||
<h1>Můj košík</h1>
|
||||
<p>Vše, co sis vybral, na jednom místě.</p>
|
||||
</div>
|
||||
|
||||
@if (isLoading)
|
||||
{
|
||||
<p>Načítám košík...</p>
|
||||
}
|
||||
else if (cartItems.Count == 0)
|
||||
{
|
||||
<div class="cart-empty">
|
||||
<div class="cart-empty-icon">🛒</div>
|
||||
<h2>Košík je zatím prázdný</h2>
|
||||
<p>V katalogu na tebe čeká spousta zajímavých produktů.</p>
|
||||
<a href="/" class="cart-primary-button">Prohlédnout katalog</a>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="cart-layout">
|
||||
<section class="cart-product-list">
|
||||
<div class="cart-list-heading">
|
||||
<h2>Vybrané produkty</h2>
|
||||
<span>@cartItems.Count položek</span>
|
||||
</div>
|
||||
<a href="/" class="cart-back-link">← Pokračovat v nákupu</a>
|
||||
</div>
|
||||
|
||||
@if (isLoading)
|
||||
{
|
||||
<p>Načítám košík...</p>
|
||||
}
|
||||
else if (cartItems.Count == 0)
|
||||
{
|
||||
<div class="cart-empty">
|
||||
<div class="cart-empty-icon">🛒</div>
|
||||
<h2>Košík je zatím prázdný</h2>
|
||||
<p>V katalogu na tebe čeká spousta zajímavých produktů.</p>
|
||||
<a href="/" class="cart-primary-button">Prohlédnout katalog</a>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="cart-layout">
|
||||
|
||||
<section class="cart-product-list">
|
||||
|
||||
<div class="cart-list-heading">
|
||||
<h2>Vybrané produkty</h2>
|
||||
<span>@cartItems.Count položek</span>
|
||||
</div>
|
||||
|
||||
@foreach (var item in cartItems)
|
||||
{
|
||||
<article class="cart-product" @key="item.Id">
|
||||
|
||||
<div class="cart-product-image">
|
||||
@if (!string.IsNullOrWhiteSpace(item.Product.ImageUrl))
|
||||
{
|
||||
<img src="@item.Product.ImageUrl"
|
||||
alt="@item.Product.Name" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>🎁</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="cart-product-info">
|
||||
<h3>@item.Product.Name</h3>
|
||||
|
||||
@if (item.Product.Category != null)
|
||||
{
|
||||
<span class="cart-category">
|
||||
@item.Product.Category.Name
|
||||
</span>
|
||||
}
|
||||
|
||||
<p>@item.Product.Price.ToString("N0") Kč / ks</p>
|
||||
</div>
|
||||
|
||||
<div class="cart-product-quantity">
|
||||
<span>Množství</span>
|
||||
|
||||
<div class="cart-quantity-controls">
|
||||
|
||||
<button type="button"
|
||||
@onclick="() => ChangeQuantity(item, -1)"
|
||||
disabled="@(item.Quantity <= 1)"
|
||||
aria-label="Odebrat jeden kus">
|
||||
−
|
||||
</button>
|
||||
|
||||
<strong>@item.Quantity</strong>
|
||||
|
||||
<button type="button"
|
||||
@onclick="() => ChangeQuantity(item, 1)"
|
||||
disabled="@(item.Quantity >= item.Product.StockQuantity)"
|
||||
aria-label="Přidat jeden kus">
|
||||
+
|
||||
</button>
|
||||
|
||||
@foreach (var item in cartItems)
|
||||
{
|
||||
<article class="cart-product" @key="item.Id">
|
||||
<div class="cart-product-image">
|
||||
@if (!string.IsNullOrWhiteSpace(item.Product.ImageUrl))
|
||||
{
|
||||
<img src="@item.Product.ImageUrl"
|
||||
alt="@item.Product.Name" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>🎁</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cart-product-info">
|
||||
<h3>@item.Product.Name</h3>
|
||||
@if (item.Product.Category != null)
|
||||
{
|
||||
<span class="cart-category">
|
||||
@item.Product.Category.Name
|
||||
</span>
|
||||
}
|
||||
<p>@item.Product.Price.ToString("N0") Kč / ks</p>
|
||||
</div>
|
||||
<div class="cart-product-price">
|
||||
<strong>
|
||||
@((item.Product.Price * item.Quantity).ToString("N0")) Kč
|
||||
</strong>
|
||||
|
||||
<div class="cart-product-quantity">
|
||||
<span>Množství</span>
|
||||
<strong>@item.Quantity ks</strong>
|
||||
</div>
|
||||
<button type="button"
|
||||
class="cart-remove-button"
|
||||
@onclick="() => RemoveFromCart(item)">
|
||||
Odstranit
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="cart-product-price">
|
||||
<strong>
|
||||
@((item.Product.Price * item.Quantity).ToString("N0")) Kč
|
||||
</strong>
|
||||
</div>
|
||||
</article>
|
||||
}
|
||||
</section>
|
||||
</article>
|
||||
}
|
||||
|
||||
<aside class="cart-summary">
|
||||
<h2>Souhrn objednávky</h2>
|
||||
</section>
|
||||
|
||||
<div class="cart-summary-row">
|
||||
<span>Počet kusů</span>
|
||||
<strong>@cartItems.Sum(i => i.Quantity)</strong>
|
||||
</div>
|
||||
<aside class="cart-summary">
|
||||
|
||||
<div class="cart-summary-row">
|
||||
<span>Počet produktů</span>
|
||||
<strong>@cartItems.Count</strong>
|
||||
</div>
|
||||
<h2>Souhrn objednávky</h2>
|
||||
|
||||
<div class="cart-summary-divider"></div>
|
||||
<div class="cart-summary-row">
|
||||
<span>Počet kusů</span>
|
||||
<strong>@cartItems.Sum(i => i.Quantity)</strong>
|
||||
</div>
|
||||
|
||||
<div class="cart-summary-total">
|
||||
<span>Celkem</span>
|
||||
<strong>@totalPrice.ToString("N0") Kč</strong>
|
||||
</div>
|
||||
<div class="cart-summary-row">
|
||||
<span>Počet produktů</span>
|
||||
<strong>@cartItems.Count</strong>
|
||||
</div>
|
||||
|
||||
<button class="cart-primary-button" disabled>
|
||||
Pokračovat k objednávce
|
||||
</button>
|
||||
<div class="cart-summary-divider"></div>
|
||||
|
||||
<p class="cart-summary-note">
|
||||
Objednávku dokončíš v dalším kroku.
|
||||
</p>
|
||||
</aside>
|
||||
</div>
|
||||
}
|
||||
</main>
|
||||
<div class="cart-summary-total">
|
||||
<span>Celkem</span>
|
||||
<strong>@totalPrice.ToString("N0") Kč</strong>
|
||||
</div>
|
||||
|
||||
<button class="cart-primary-button" disabled>
|
||||
Pokračovat k objednávce
|
||||
</button>
|
||||
|
||||
<p class="cart-summary-note">
|
||||
Objednávku dokončíš v dalším kroku.
|
||||
</p>
|
||||
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
</main>
|
||||
|
||||
@code {
|
||||
private string? cartToken;
|
||||
|
||||
private List<CartItem> cartItems = new();
|
||||
|
||||
private bool isLoading = true;
|
||||
|
||||
private PersistingComponentStateSubscription? subscription;
|
||||
@@ -156,6 +193,7 @@
|
||||
.AsNoTracking()
|
||||
.Include(c => c.CartItems)
|
||||
.ThenInclude(ci => ci.Product)
|
||||
.ThenInclude(p => p.Category)
|
||||
.FirstOrDefaultAsync(c => c.Token == cartToken);
|
||||
|
||||
if (cart != null)
|
||||
@@ -169,6 +207,68 @@
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ChangeQuantity(CartItem item, int change)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(cartToken))
|
||||
return;
|
||||
|
||||
var cart = await DbContext.Carts
|
||||
.FirstOrDefaultAsync(c => c.Token == cartToken);
|
||||
|
||||
if (cart == null)
|
||||
return;
|
||||
|
||||
var cartItem = await DbContext.CartItems
|
||||
.Include(ci => ci.Product)
|
||||
.FirstOrDefaultAsync(ci =>
|
||||
ci.Id == item.Id &&
|
||||
ci.CartId == cart.Id);
|
||||
|
||||
if (cartItem == null)
|
||||
return;
|
||||
|
||||
int newQuantity = cartItem.Quantity + change;
|
||||
|
||||
if (newQuantity < 1 ||
|
||||
newQuantity > cartItem.Product.StockQuantity)
|
||||
return;
|
||||
|
||||
cartItem.Quantity = newQuantity;
|
||||
cart.UpdatedAt = DateTime.UtcNow;
|
||||
|
||||
await DbContext.SaveChangesAsync();
|
||||
|
||||
item.Quantity = newQuantity;
|
||||
}
|
||||
|
||||
private async Task RemoveFromCart(CartItem item)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(cartToken))
|
||||
return;
|
||||
|
||||
var cart = await DbContext.Carts
|
||||
.FirstOrDefaultAsync(c => c.Token == cartToken);
|
||||
|
||||
if (cart == null)
|
||||
return;
|
||||
|
||||
var cartItem = await DbContext.CartItems
|
||||
.FirstOrDefaultAsync(ci =>
|
||||
ci.Id == item.Id &&
|
||||
ci.CartId == cart.Id);
|
||||
|
||||
if (cartItem == null)
|
||||
return;
|
||||
|
||||
DbContext.CartItems.Remove(cartItem);
|
||||
|
||||
cart.UpdatedAt = DateTime.UtcNow;
|
||||
|
||||
await DbContext.SaveChangesAsync();
|
||||
|
||||
cartItems.Remove(item);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
subscription?.Dispose();
|
||||
|
||||
@@ -1,5 +1,207 @@
|
||||
<h3>NovaObjednavka</h3>
|
||||
@page "/nova-objednavka"
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Web_Jarmark.Data
|
||||
@using Web_Jarmark.Data.Models
|
||||
@inject ApplicationDbContext DbContext
|
||||
@inject IHttpContextAccessor HttpContextAccessor
|
||||
@inject PersistentComponentState ApplicationState
|
||||
@inject NavigationManager Navigation
|
||||
@implements IDisposable
|
||||
|
||||
<PageTitle>Dokončení objednávky | Školní jarmark</PageTitle>
|
||||
|
||||
<main class="market-shell">
|
||||
<h1>Dokončení objednávky</h1>
|
||||
|
||||
@if (isLoading)
|
||||
{
|
||||
<p>Načítám objednávku...</p>
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(errorMessage))
|
||||
{
|
||||
<p>@errorMessage</p>
|
||||
<a href="/kosik">Zpět do košíku</a>
|
||||
}
|
||||
else if (cartItems.Count == 0)
|
||||
{
|
||||
<p>Košík je prázdný.</p>
|
||||
<a href="/">Zpět do katalogu</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<section>
|
||||
<h2>Vybrané produkty</h2>
|
||||
|
||||
@foreach (var item in cartItems)
|
||||
{
|
||||
<p>
|
||||
@item.Product.Name – @item.Quantity ks –
|
||||
@((item.Product.Price * item.Quantity).ToString("N0")) Kč
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Celkem: @totalPrice.ToString("N0") Kč</h3>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Způsob platby</h2>
|
||||
|
||||
<label>
|
||||
<input type="radio"
|
||||
name="payment"
|
||||
checked="@(selectedPayment == PaymentMethod.BankTransfer)"
|
||||
@onchange="@(() => selectedPayment = PaymentMethod.BankTransfer)" />
|
||||
QR platba
|
||||
</label>
|
||||
|
||||
<br />
|
||||
|
||||
<label>
|
||||
<input type="radio"
|
||||
name="payment"
|
||||
checked="@(selectedPayment == PaymentMethod.Cash)"
|
||||
@onchange="@(() => selectedPayment = PaymentMethod.Cash)" />
|
||||
Hotově na místě
|
||||
</label>
|
||||
</section>
|
||||
|
||||
<button class="cart-primary-button"
|
||||
@onclick="CreateOrder"
|
||||
disabled="@isSaving">
|
||||
@(isSaving ? "Vytvářím objednávku..." : "Potvrdit objednávku")
|
||||
</button>
|
||||
|
||||
<p>@saveError</p>
|
||||
<p><a href="/kosik">Zpět do košíku</a></p>
|
||||
}
|
||||
</main>
|
||||
|
||||
@code {
|
||||
private string? cartToken;
|
||||
private List<CartItem> cartItems = new();
|
||||
|
||||
private bool isLoading = true;
|
||||
private bool isSaving;
|
||||
private string? errorMessage;
|
||||
private string? saveError;
|
||||
|
||||
private PaymentMethod selectedPayment = PaymentMethod.BankTransfer;
|
||||
|
||||
private PersistingComponentStateSubscription? subscription;
|
||||
|
||||
private decimal totalPrice =>
|
||||
cartItems.Sum(item => item.Product.Price * item.Quantity);
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!ApplicationState.TryTakeFromJson<string>(
|
||||
"CartToken", out cartToken)
|
||||
|| string.IsNullOrWhiteSpace(cartToken))
|
||||
{
|
||||
var context = HttpContextAccessor.HttpContext;
|
||||
|
||||
cartToken = context?.Items["CartToken"] as string
|
||||
?? context?.Request.Cookies["CartToken"];
|
||||
}
|
||||
|
||||
subscription = ApplicationState.RegisterOnPersisting(() =>
|
||||
{
|
||||
ApplicationState.PersistAsJson("CartToken", cartToken);
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
|
||||
if (string.IsNullOrWhiteSpace(cartToken))
|
||||
{
|
||||
errorMessage = "Nepodařilo se najít tvůj košík.";
|
||||
return;
|
||||
}
|
||||
|
||||
var cart = await DbContext.Carts
|
||||
.AsNoTracking()
|
||||
.Include(c => c.CartItems)
|
||||
.ThenInclude(ci => ci.Product)
|
||||
.FirstOrDefaultAsync(c => c.Token == cartToken);
|
||||
|
||||
if (cart != null)
|
||||
{
|
||||
cartItems = cart.CartItems.ToList();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
errorMessage = "Při načítání košíku nastala chyba.";
|
||||
}
|
||||
finally
|
||||
{
|
||||
isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task CreateOrder()
|
||||
{
|
||||
if (isSaving || string.IsNullOrWhiteSpace(cartToken))
|
||||
return;
|
||||
|
||||
isSaving = true;
|
||||
saveError = null;
|
||||
|
||||
try
|
||||
{
|
||||
var cart = await DbContext.Carts
|
||||
.Include(c => c.CartItems)
|
||||
.ThenInclude(ci => ci.Product)
|
||||
.FirstOrDefaultAsync(c => c.Token == cartToken);
|
||||
|
||||
if (cart == null || cart.CartItems.Count == 0)
|
||||
{
|
||||
saveError = "Košík je prázdný.";
|
||||
return;
|
||||
}
|
||||
|
||||
var order = new Order
|
||||
{
|
||||
PreferredPayment = selectedPayment,
|
||||
Status = OrderStatus.Pending,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
TotalAmount = cart.CartItems.Sum(
|
||||
item => item.Product.Price * item.Quantity)
|
||||
};
|
||||
|
||||
foreach (var item in cart.CartItems)
|
||||
{
|
||||
order.OrderItems.Add(new OrderItem
|
||||
{
|
||||
ProductId = item.ProductId,
|
||||
ProductName = item.Product.Name,
|
||||
UnitPrice = item.Product.Price,
|
||||
Quantity = item.Quantity,
|
||||
Order = order,
|
||||
Product = item.Product
|
||||
});
|
||||
}
|
||||
|
||||
DbContext.Orders.Add(order);
|
||||
|
||||
DbContext.CartItems.RemoveRange(cart.CartItems);
|
||||
|
||||
await DbContext.SaveChangesAsync();
|
||||
|
||||
Navigation.NavigateTo($"/objednavka/{order.Id}");
|
||||
}
|
||||
catch
|
||||
{
|
||||
saveError = "Objednávku se nepodařilo uložit. Zkus to znovu.";
|
||||
}
|
||||
finally
|
||||
{
|
||||
isSaving = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
subscription?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Web_Jarmark.Data;
|
||||
@@ -5,35 +6,41 @@ using Web_Jarmark.Data.Models;
|
||||
|
||||
namespace Web_Jarmark.Data
|
||||
{
|
||||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : IdentityDbContext<ApplicationUser>(options)
|
||||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
|
||||
: IdentityDbContext<ApplicationUser>(options)
|
||||
{
|
||||
public DbSet<Category> Categories { get; set; }
|
||||
public DbSet<Product> Products { get; set; }
|
||||
public DbSet<Cart> Carts { get; set; }
|
||||
public DbSet<CartItem> CartItems { get; set; }
|
||||
|
||||
// Objednávky
|
||||
public DbSet<Order> Orders { get; set; }
|
||||
public DbSet<OrderItem> OrderItems { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
// Nastavení vazby 1:N mezi Category a Product
|
||||
// Kategorie a produkty
|
||||
modelBuilder.Entity<Category>()
|
||||
.HasMany(c => c.Products) // Jedna kategorie obsahuje mnoho produktů
|
||||
.WithOne(p => p.Category) // Každý produkt patří ke jedné kategorii
|
||||
.HasForeignKey(p => p.CategoryId); // Cizí klíč v tabulce Product
|
||||
.HasMany(c => c.Products)
|
||||
.WithOne(p => p.Category)
|
||||
.HasForeignKey(p => p.CategoryId);
|
||||
|
||||
// Jeden košík obsahuje více položek
|
||||
// Košík a položky košíku
|
||||
modelBuilder.Entity<Cart>()
|
||||
.HasMany(c => c.CartItems)
|
||||
.WithOne(ci => ci.Cart)
|
||||
.HasForeignKey(ci => ci.CartId);
|
||||
|
||||
// Každá položka odkazuje na jeden produkt
|
||||
// Položka košíku odkazuje na produkt
|
||||
modelBuilder.Entity<CartItem>()
|
||||
.HasOne(ci => ci.Product)
|
||||
.WithMany()
|
||||
.HasForeignKey(ci => ci.ProductId);
|
||||
|
||||
// Jeden produkt může být v košíku pouze jednou
|
||||
// Produkt může být v košíku pouze jednou
|
||||
modelBuilder.Entity<CartItem>()
|
||||
.HasIndex(ci => new { ci.CartId, ci.ProductId })
|
||||
.IsUnique();
|
||||
@@ -42,7 +49,19 @@ namespace Web_Jarmark.Data
|
||||
modelBuilder.Entity<Cart>()
|
||||
.HasIndex(c => c.Token)
|
||||
.IsUnique();
|
||||
|
||||
// Objednávka a její položky
|
||||
modelBuilder.Entity<Order>()
|
||||
.HasMany(o => o.OrderItems)
|
||||
.WithOne(oi => oi.Order)
|
||||
.HasForeignKey(oi => oi.OrderId);
|
||||
|
||||
// Položka objednávky odkazuje na produkt
|
||||
modelBuilder.Entity<OrderItem>()
|
||||
.HasOne(oi => oi.Product)
|
||||
.WithMany()
|
||||
.HasForeignKey(oi => oi.ProductId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
Delivered,
|
||||
Cancelled
|
||||
}
|
||||
|
||||
public enum PaymentMethod
|
||||
{
|
||||
CreditCard,
|
||||
@@ -19,23 +20,21 @@
|
||||
public class Order
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Code { get; set; }
|
||||
public OrderStatus Status { get; set; }
|
||||
public string CustomerName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Phone { get; set; }
|
||||
public string Note { get; set; }
|
||||
public PaymentMethod PreferredPayment { get; set; }
|
||||
public string PaymentReference { get; set; }
|
||||
public decimal TotalAmount { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime? ExpiresAt { get; set; }
|
||||
public DateTime? PaidAt { get; set; }
|
||||
public DateTime? IssuedAt { get; set; }
|
||||
public string IssuedByUserId { get; set; }
|
||||
public DateTime? CancelledAt { get; set; }
|
||||
|
||||
// Navigační vlastnost pro objednávací položky
|
||||
public string Code { get; set; } = Guid.NewGuid().ToString("N")[..8].ToUpper();
|
||||
|
||||
public OrderStatus Status { get; set; } = OrderStatus.Pending;
|
||||
|
||||
public PaymentMethod PreferredPayment { get; set; }
|
||||
|
||||
public string? PaymentReference { get; set; }
|
||||
|
||||
public decimal TotalAmount { get; set; }
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public DateTime? PaidAt { get; set; }
|
||||
|
||||
public ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3061,3 +3061,58 @@ textarea.wj-input {
|
||||
background: #f0f0f2;
|
||||
color: #6e6e73;
|
||||
}
|
||||
|
||||
/* Ovládání množství v košíku */
|
||||
.cart-quantity-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.cart-quantity-controls strong {
|
||||
min-width: 22px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.cart-quantity-controls button {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: #222;
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
.cart-quantity-controls button:hover:not(:disabled) {
|
||||
background: #444;
|
||||
}
|
||||
|
||||
.cart-quantity-controls button:disabled {
|
||||
opacity: 0.35;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* Odstranìní produktu */
|
||||
.cart-remove-button {
|
||||
display: block;
|
||||
margin-top: 12px;
|
||||
padding: 8px 12px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: #dc3545;
|
||||
color: white;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
.cart-remove-button:hover {
|
||||
background: #b02a37;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user