Исправлены расчеты цен в корзине и добавлена логика загрузки единиц для категорий. Обновлены компоненты CartInfo, CartList, CartSummary, VinCategory и VinLeftbar для корректного отображения итоговых цен и улучшения взаимодействия с пользователем.

This commit is contained in:
Bivekich
2025-07-08 13:25:49 +03:00
parent f0e873fdd1
commit 8055886082
7 changed files with 231 additions and 107 deletions

View File

@ -65,7 +65,8 @@ const calculateSummary = (items: CartItem[], deliveryPrice: number) => {
const discount = item.originalPrice ? (item.originalPrice - item.price) * item.quantity : 0
return sum + discount
}, 0)
const finalPrice = totalPrice + deliveryPrice
// Доставка включена в стоимость товаров, поэтому добавляем её только если есть товары
const finalPrice = totalPrice + (totalPrice > 0 ? 0 : 0) // Доставка всегда включена в цену товаров
return {
totalItems,