Spaces:
Sleeping
Sleeping
Update app.py
Browse files286 unmodified lines287288289290291292293294295296297120 unmodified lines418419420421422423142 unmodified lines566567568569570571286 unmodified lines.clear-cart {background-color: #e74c3c;margin-top: 10px;float: right;}.clear-cart:hover {background-color: #c0392b;}@media (max-width: 768px) {body {padding: 10px;120 unmodified lines<div style="margin-top: 20px; text-align: right;"><strong>Итого: <span id="cartTotal">0</span> ₽</strong><button class="product-button clear-cart" onclick="clearCart()">Очистить корзину</button></div></div></div>142 unmodified linesdocument.getElementById('cartModal').style.display = 'block';}function clearCart() {console.log("Очистка корзины");localStorage.removeItem('cart');286 unmodified lines287288289290291292293294295296297298299300301302303304120 unmodified lines425426427428429430431142 unmodified lines574575576577578579580581582583584585586587588589590591592593594595596597598599600286 unmodified lines.clear-cart {background-color: #e74c3c;margin-top: 10px;margin-right: 10px;}.clear-cart:hover {background-color: #c0392b;}.order-button {background-color: #25D366;margin-top: 10px;}.order-button:hover {background-color: #20B956;}@media (max-width: 768px) {body {padding: 10px;120 unmodified lines<div style="margin-top: 20px; text-align: right;"><strong>Итого: <span id="cartTotal">0</span> ₽</strong><button class="product-button clear-cart" onclick="clearCart()">Очистить корзину</button><button class="product-button order-button" onclick="orderViaWhatsApp()">Заказать</button></div></div></div>142 unmodified linesdocument.getElementById('cartModal').style.display = 'block';}function orderViaWhatsApp() {const cart = JSON.parse(localStorage.getItem('cart') || '[]');if (cart.length === 0) {alert("Корзина пуста! Добавьте товары перед заказом.");return;}let total = 0;let orderText = "Заказ:%0A";cart.forEach((item, index) => {const itemTotal = item.price * item.quantity;total += itemTotal;orderText += `${index + 1}. ${item.name} - ${item.price} ₽ × ${item.quantity}%0A`;});orderText += `Итого: ${total} ₽`;const whatsappUrl = `https://api.whatsapp.com/send?phone=996500398754&text=${orderText}`;window.open(whatsappUrl, '_blank');console.log("Переход в WhatsApp с заказом:", orderText);}function clearCart() {console.log("Очистка корзины");localStorage.removeItem('cart');
app.py+30-1