From 16f68f469d0b58bf4a3375d13f4a07f1fba62436 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Tue, 30 Jun 2026 17:47:46 +0000 Subject: [PATCH] Auto commit: 2026-06-30T17:47:46.239Z --- assets/css/custom.css | 89 +++++++++++++++++++++++++++++++++++++++++++ cart.php | 16 +++++++- checkout.php | 13 ++++++- includes/store.php | 5 +++ index.php | 24 ++++++++---- product.php | 11 ++++-- 6 files changed, 145 insertions(+), 13 deletions(-) diff --git a/assets/css/custom.css b/assets/css/custom.css index cec9af7..d03e2e1 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -109,6 +109,53 @@ h1, h2, h3 { letter-spacing: -.04em; } } .status-row strong { color: var(--primary-dark); } +.payment-icons { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 8px; +} +.payment-icons.compact { margin-top: 8px; } +.payment-card-icon { + min-width: 74px; + height: 34px; + border-radius: 9px; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0 10px; + font-size: .78rem; + font-weight: 900; + letter-spacing: .03em; + border: 1px solid rgba(18, 49, 31, .14); + box-shadow: 0 8px 16px rgba(18, 49, 31, .08); +} +.payment-card-icon.visa { + background: linear-gradient(135deg, #1434cb 0%, #1a4cff 100%); + color: #fff; + font-style: italic; + letter-spacing: .1em; +} +.payment-card-icon.mastercard { + position: relative; + justify-content: flex-end; + min-width: 112px; + padding-left: 42px; + background: #fff; + color: #231f20; +} +.payment-card-icon.mastercard::before, +.payment-card-icon.mastercard::after { + content: ""; + position: absolute; + top: 8px; + width: 19px; + height: 19px; + border-radius: 999px; +} +.payment-card-icon.mastercard::before { left: 12px; background: rgba(235, 0, 27, .9); } +.payment-card-icon.mastercard::after { left: 25px; background: rgba(247, 158, 27, .9); mix-blend-mode: multiply; } + .section-heading { margin-bottom: 22px; max-width: 760px; } .section-heading p { color: var(--muted); margin: 0; } .product-card { overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; } @@ -168,6 +215,45 @@ h1, h2, h3 { letter-spacing: -.04em; } .whatsapp-float:hover { background: #0f8a43; color: #fff; transform: translateY(-2px); } .cart-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; } + +.checkout-panel { + display: flex; + align-items: center; + justify-content: space-between; + gap: 18px; + padding: 20px; + border-color: #ffc247; +} +.checkout-panel h2 { + margin: 10px 0 6px; + font-size: 1.35rem; +} +.checkout-panel p { + margin: 0; + color: var(--muted); +} +.checkout-panel-actions { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 12px; + flex-wrap: wrap; + min-width: min(100%, 360px); +} +.accepted-cards { + border: 1px solid var(--border); + border-radius: 12px; + padding: 12px; + margin-bottom: 18px; + background: #fffaf0; +} +.accepted-cards > span { + display: block; + color: var(--muted); + font-size: .86rem; + font-weight: 800; + margin-bottom: 8px; +} .total, .summary-total { font-size: 1.1rem; font-weight: 900; } .form-panel, .summary { padding: 20px; } .summary h2 { font-size: 1.25rem; } @@ -223,5 +309,8 @@ h1, h2, h3 { letter-spacing: -.04em; } .product-visual.detail { height: 260px; } .cart-actions { align-items: stretch; } .cart-actions .btn { width: 100%; } + .checkout-panel { align-items: stretch; flex-direction: column; } + .checkout-panel-actions { justify-content: stretch; min-width: 100%; } + .checkout-panel-actions .btn { width: 100%; } .total { width: 100%; } } diff --git a/cart.php b/cart.php index ed2ca01..bb60d2d 100644 --- a/cart.php +++ b/cart.php @@ -16,11 +16,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { header('Location: cart.php'); exit; } $items = cart_items(); +$addedProduct = isset($_GET['added']) ? get_product((string)$_GET['added']) : null; layout_header('Carrito', 'Carrito de compra LA BORGUITA con precios en dólares.'); ?>
Carrito

Revisa tu compra

Ajusta cantidades antes de subir el comprobante de pago.

+

Tu carrito está vacío

Agrega productos del catálogo para iniciar un pedido.

Ir al catálogo
@@ -29,8 +31,20 @@ layout_header('Carrito', 'Carrito de compra LA BORGUITA con precios en dólares.
ProductoPrecioCantidadTotal

Stock
-
Total:
Continuar al pago
+
Seguir comprando
+
+
+ Carrito activo +

Listo para elegir forma de pago

+

Tu carrito ya tiene productos. Continúa para seleccionar QR, Visa, Mastercard o transferencia.

+ +
+
+
Total:
+ Continuar al pago +
+
diff --git a/checkout.php b/checkout.php index 817bdca..7374aec 100644 --- a/checkout.php +++ b/checkout.php @@ -56,6 +56,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $successId = isset($_GET['success']) ? (int)$_GET['success'] : 0; $order = $successId ? get_order($successId) : null; +$selectedMethod = (string)($_POST['payment_method'] ?? 'qr'); layout_header('Checkout', 'Checkout con QR, tarjeta, transferencia y comprobante manual para LA BORGUITA.'); ?>
@@ -74,7 +75,15 @@ layout_header('Checkout', 'Checkout con QR, tarjeta, transferencia y comprobante
-
+
+ + + +
JPG, PNG o PDF hasta 8 MB. El admin aprobará manualmente.
@@ -82,7 +91,7 @@ layout_header('Checkout', 'Checkout con QR, tarjeta, transferencia y comprobante
- +
diff --git a/includes/store.php b/includes/store.php index 8d122d4..344e8d2 100644 --- a/includes/store.php +++ b/includes/store.php @@ -75,6 +75,11 @@ function money(float $amount): string { return '$' . number_format($amount, 2) . ' USD'; } +function payment_icons_html(string $extraClass = ''): string { + $class = trim('payment-icons ' . $extraClass); + return '
VISAMastercard
'; +} + function ensure_orders_table(): void { db()->exec("CREATE TABLE IF NOT EXISTS lb_orders ( id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, diff --git a/index.php b/index.php index 5d3813a..50d03e8 100644 --- a/index.php +++ b/index.php @@ -10,8 +10,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] ?? '') === 'add') $product = get_product($id); if ($product) { $_SESSION['cart'][$id] = min((int)$product['stock'], (int)($_SESSION['cart'][$id] ?? 0) + $qty); - $notice = $product['name'] . ' añadido al carrito.'; + $next = (string)($_POST['next'] ?? 'cart'); + if ($next === 'checkout') { + header('Location: checkout.php'); + exit; + } + header('Location: cart.php?added=' . rawurlencode($id)); + exit; } + $notice = 'No pudimos agregar el producto. Inténtalo de nuevo.'; } layout_header('Tienda virtual', 'LA BORGUITA: tienda virtual con catálogo, carrito, QR de pago y confirmación manual.'); @@ -33,7 +40,7 @@ $logoPath = store_logo_path();
-
LA BORGUITAPagos Visa · Mastercard · Transferencia
+
LA BORGUITAPagos Visa · Mastercard · Transferencia
Espacio para QR de pagoSube aquí tu QR definitivo desde el editor cuando lo tengas listo.
Pedidos pendientesRevisión manual
@@ -59,12 +66,15 @@ $logoPath = store_logo_path();

-
+ - - - Detalle +
+ + + + Detalle +
@@ -78,7 +88,7 @@ $logoPath = store_logo_path();
QR reservadoBloque visual listo para colocar el código real.
-
Visa/MastercardMétodo visible para integrar pasarelas MX/US.
+
Visa/MastercardMétodo visible para integrar pasarelas MX/US.
Admin apruebaLos comprobantes quedan pendientes hasta revisión.
diff --git a/product.php b/product.php index 83a5dac..57d2ad3 100644 --- a/product.php +++ b/product.php @@ -7,7 +7,11 @@ if (!$product) { http_response_code(404); layout_header('Producto no encontrado' if ($_SERVER['REQUEST_METHOD'] === 'POST') { $qty = max(1, min((int)$product['stock'], (int)($_POST['qty'] ?? 1))); $_SESSION['cart'][$product['id']] = min((int)$product['stock'], (int)($_SESSION['cart'][$product['id']] ?? 0) + $qty); - header('Location: cart.php'); + if (($_POST['next'] ?? 'cart') === 'checkout') { + header('Location: checkout.php'); + exit; + } + header('Location: cart.php?added=' . rawurlencode((string)$product['id'])); exit; } layout_header($product['name'], $product['description']); @@ -23,9 +27,10 @@ layout_header($product['name'], $product['description']);

Disponible en almacén: unidades

-
+ - + +