update goods

This commit is contained in:
Kirill
2026-05-15 12:50:39 +05:00
parent c5634deb51
commit 89d605adf4
21 changed files with 1594 additions and 306 deletions
@@ -80,8 +80,7 @@ export function CheckoutPage() {
const deliveryFeeCents = deliveryType === 'delivery' && items.length > 0 ? 50000 : 0
const total = itemsSubtotalCents + deliveryFeeCents
const addresses = addressesQuery.data?.items ?? []
const hasOverLimit = items.some((x) => x.qty > (x.product.inStock ? x.product.quantity : 1))
const hasMadeToOrder = items.some((x) => !x.product.inStock)
const hasOverLimit = items.some((x) => x.qty > x.product.quantity)
return (
<Box>
@@ -105,7 +104,7 @@ export function CheckoutPage() {
<Typography sx={{ fontWeight: 700, mb: 1 }}>Позиции</Typography>
<Stack spacing={0.5}>
{items.map((x) => {
const available = x.product.inStock ? x.product.quantity : 1
const available = x.product.quantity
const over = x.qty > available
return (
<Typography key={x.id} color={over ? 'error' : 'text.primary'}>
@@ -127,12 +126,6 @@ export function CheckoutPage() {
</Alert>
)}
{hasMadeToOrder && (
<Alert severity="info">
В заказе есть товары «под заказ». Доставка будет после изготовления (срок указан в карточке товара).
</Alert>
)}
<FormControl size="small" fullWidth>
<InputLabel id="delivery-type-label">Способ получения</InputLabel>
<Select