{{@title}} - {{@site_title}}

{{@brand_name}}

Shopping Cart
cart
{{@rs}}{{@results.totals}}{{@results.totals}} {{@rs_name}}
style="display:none;" style="display:block;" >
empty-box

Your Cart Is Empty

Nulla porttitor accumsan tincidunt Sed porttitor lectus nibh. Nulla quis lorem

Add Now
style="display:block;" style="display:none;">

Total

{{@rs}}{{@overtotal}}{{@overtotal}} {{@rs_name}}

Proceed To Checkout
$('.dropdown-menu a.dropdown-toggle').on('click', function(e) { if (!$(this).next().hasClass('show')) { $(this).parents('.dropdown-menu').first().find('.show').removeClass("show"); } var $subMenu = $(this).next(".dropdown-menu"); $subMenu.toggleClass('show'); $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function(e) { $('.dropdown-submenu .show').removeClass("show"); }); return false; }); jQuery.validator.setDefaults({ onfocusout: function (e) { this.element(e); }, onkeyup: true, onkeypress: true, onblur :true, onchange : true, highlight: function (element) { jQuery(element).closest('.form-control').addClass('is-invalid'); }, unhighlight: function (element) { jQuery(element).closest('.form-control').removeClass('is-invalid'); jQuery(element).closest('.form-control').addClass('is-valid'); }, errorElement: 'div', errorClass: 'invalid-feedback', errorPlacement: function (error, element) { if (element.parent('.input-group-prepend').length) { $(element).siblings(".invalid-feedback").append(error); //error.insertAfter(element.parent()); } else { error.insertAfter(element); } }, }); $('#check_outs').validate({ rules:{ c_name: { required: true },c_email: { required: true },c_state: { required: true },c_city: { required: true },c_address: { required: true },c_phone: { required: true, number: true, minlength: 10, maxlength: 10 },c_pin: { required: true, number: true, minlength: 6, maxlength: 6 }, }, messages: { c_name: { required: "Enter your name", },c_email: { required: "Enter your email address", },c_state: { required: "Enter your state", },c_city: { required: "Enter your city", },c_address: { required: "Enter your address", },c_phone: { required: "Enter your phone number", number: "Enter valid phone number", minlength: "Enter valid 10 digit phone number", maxlength: "Enter valid 10 digit phone number" },c_pin: { required: "Enter your pincode", number: "Enter valid pincode", minlength: "Enter valid 6 digit pincode", maxlength: "Enter valid 6 digit pincode" }, } }); // Function to handle adding items to the side cart function addToSideCart(data) { const sideCart = document.querySelector('.side-cart'); if (sideCart) { const sideCartItems = sideCart.querySelectorAll('.product-item'); // Check if there's an existing item with the matching data-prods-sidecart-id let existingItem = Array.from(sideCartItems).find(item => { const cartId = item.getAttribute('data-prods-sidecart-id'); return cartId === `${data.prodid}${data.prodvariation}`; }); if (existingItem) { // Update existing product quantity and price in side-cart const qtyInput = existingItem.querySelector('.side-cart-prod-qty'); const priceSpan = existingItem.querySelector('.side-cart-prod-totals'); qtyInput.value = data.prodqty; if("{{@rs}}"){ priceSpan.textContent = `{{@rs}}${data.prodtotal}`; $('.side-cart-prod-over-totals').text(`{{@rs}}${data.prodovertotal}`); }else{ priceSpan.textContent = `${data.prodtotal} {{@rs_name}}`; $('.side-cart-prod-over-totals').text(`${data.prodovertotal} {{@rs_name}}`); } } else { if("{{@rs}}"){ $('.side-cart-prod-over-totals').text(`{{@rs}}${data.prodovertotal}`); }else{ $('.side-cart-prod-over-totals').text(`${data.prodovertotal} {{@rs_name}}`); } // Add new product item to side-cart const newProductHTML = `
cart
{{@rs}}${data.prodtotal}${data.prodtotal} {{@rs_name}}
`; // Append the new product HTML to the side-cart container sideCart.insertAdjacentHTML('beforeend', newProductHTML); } } } cartButtons = document.querySelectorAll(".addtocartbtn-prod"); cartButtons.forEach(btnCart => { btnCart.addEventListener("click", function(event) { event.preventDefault(); const quantity_pro = $('.cart-number').val(); let variation = ''; let var_price = ''; const activeSizeElement = $('.single-size.active'); if (activeSizeElement.length > 0) { variation = activeSizeElement.attr('data-var-size'); var_price = activeSizeElement.attr('data-var-price'); } const activeColorInput = document.querySelector('input[name="modal-product-color"]:checked'); if (activeColorInput) { variation = activeColorInput.getAttribute('data-var-color'); var_price = activeColorInput.getAttribute('data-var-price'); } let pid = this.dataset.pid; let qty = quantity_pro; let bodyParams = { 'pid': pid, 'qty': qty, }; if (variation !== '' && var_price !== '') { bodyParams.variation = variation; bodyParams.var_price = var_price; } fetch("{{@SITE}}/add-to-cart", { method: 'POST', body: new URLSearchParams(bodyParams) }).then(response => { return response.json(); }).then(data => { //console.log(data); //console.log(data.quantity); $('.counts').text(data.quantity); addToSideCart(data); if(data.quantity>=1){ $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); $(".offcanvas .empty-wish-list ").css("display", "none"); $(".offcanvas .total-bottom-part ").css("display", "block"); }else{ $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); } $(".offcanvas .empty-wish-list ").css("display", "none"); $(".offcanvas .total-bottom-part ").css("display", "block"); const Toast = Swal.mixin({ toast: true, position: 'center-end', showConfirmButton: false, timer: 1500, timerProgressBar: true, didOpen: (toast) => { toast.addEventListener('mouseenter', Swal.stopTimer) toast.addEventListener('mouseleave', Swal.resumeTimer) } }) Toast.fire({ icon: 'success', title: 'Product added to cart' }); }); }); }); $(document).on('click','.addtocartbtnside',function(){ event.preventDefault(); let pid = this.dataset.pid; let variation = this.closest('.single-grid-product').getAttribute('data-sideVarSize'); let var_price = this.closest('.single-grid-product').getAttribute('data-sideVarPrice'); let bodyParams = { 'pid': pid }; if (variation !== null && variation !== '') { bodyParams.variation = variation; } if (var_price !== null && var_price !== '') { bodyParams.var_price = var_price; } fetch("{{@SITE}}/add-to-cart", { method: 'POST', body: new URLSearchParams(bodyParams) }).then(response => { return response.json(); }).then(data => { //console.log(data); //console.log(data.quantity); if("{{@rs}}"){ $('.side-cart-prod-over-totals').text(`{{@rs}}${data.prodovertotal}`); }else{ $('.side-cart-prod-over-totals').text(`${data.prodovertotal} {{@rs_name}}`); } $('.counts').text(data.quantity); // Call function to add item to side cart addToSideCart(data); // Show or hide elements based on quantity if (data.quantity >= 1) { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); $(".offcanvas .empty-wish-list ").css("display", "none"); $(".offcanvas .total-bottom-part ").css("display", "block"); } else { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); } // Show success message const Toast = Swal.mixin({ toast: true, position: 'center-end', showConfirmButton: false, timer: 1500, timerProgressBar: true, didOpen: (toast) => { toast.addEventListener('mouseenter', Swal.stopTimer) toast.addEventListener('mouseleave', Swal.resumeTimer) } }); Toast.fire({ icon: 'success', title: 'Product added to cart' }); }); }); $(document).on('click','.removecartbtnsides',function(){ event.preventDefault(); let pid = this.dataset.pid; let qtyInput = this.closest('.product-item').querySelector('.side-cartqty'); // Get the closest cartqty input field let qty = qtyInput.value; let variation = this.closest('.single-grid-product').getAttribute('data-sideVarSize'); let var_price = this.closest('.single-grid-product').getAttribute('data-sideVarPrice'); let bodyParams = { 'pid': pid }; if (variation !== null && variation !== '') { bodyParams.variation = variation; bodyParams.var_price = var_price; } //console.log(`Quantity: ${qty}, Product ID: ${pid}`); if (qty > 1) { //alert(qty) fetch("{{@SITE}}/remove", { method: 'POST', body: new URLSearchParams(bodyParams) }) .then(response => response.json()) .then(data => { //console.log(data); $('.counts').text(data.quantity); addToSideCart(data); if (data.quantity >= 1) { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); } else { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); } }); } else { fetch("{{@SITE}}/remove-prod", { method: 'POST', body: new URLSearchParams(bodyParams) }) .then(response => response.json()) .then(data => { //console.log(data); if("{{@rs}}"){ $('.side-cart-prod-over-totals').text(`{{@rs}}${data.prodovertotal}`); }else{ $('.side-cart-prod-over-totals').text(`${data.prodovertotal} {{@rs_name}}`); } $(`[data-prods-sidecart-id="${data.cartid}"]`).remove(); var quantitySpan = $('#quantitys'); // Get the span element using jQuery if (parseInt(quantitySpan.text()) ===1) { $(".offcanvas .empty-wish-list ").css("display", "block"); $(".offcanvas .total-bottom-part ").css("display", "none"); } $('.counts').text(data.quantity); if (data.quantity >= 1) { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); } else { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); } }) } }); $(document).on('click','.emptyprodbtnsides',function(){ event.preventDefault(); let pid = this.dataset.pid; let variation = this.closest('.single-grid-product').getAttribute('data-sideVarSize'); let var_price = this.closest('.single-grid-product').getAttribute('data-sideVarPrice'); let bodyParams = { 'pid': pid }; if (variation !== null && variation !== '') { bodyParams.variation = variation; bodyParams.var_price = var_price; } fetch("{{@SITE}}/remove-prod", { method: 'POST', body: new URLSearchParams(bodyParams) }).then(response => { $(this).closest("tr").remove(); update_amounts(); return response.json(); }).then(data => { //console.log(data); if (data.quantity ===null) { $(".offcanvas .empty-wish-list ").css("display", "block"); $(".offcanvas .total-bottom-part ").css("display", "none"); } if("{{@rs}}"){ $('.side-cart-prod-over-totals').text(`{{@rs}}${data.prodovertotal}`); }else{ $('.side-cart-prod-over-totals').text(`${data.prodovertotal} {{@rs_name}}`); } $(`[data-prods-sidecart-id="${data.cartid}"]`).remove(); $('.counts').text(data.quantity); if(data.quantity>=1){ $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); } else{ $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); //window.location = "{{@SITE}}/cart"; } }); }); $(document).ready(function() { var cartButtonss = document.querySelectorAll(".addtocartbtns"); cartButtonss.forEach(btnCart => { btnCart.addEventListener("click", function(event) { event.preventDefault(); let pid = this.dataset.pid; let variation = this.closest('.single-grid-product').getAttribute('data-sideVarSize'); let var_price = this.closest('.single-grid-product').getAttribute('data-sideVarPrice'); let bodyParams = { 'pid': pid }; if (variation !== null && variation !== '') { bodyParams.variation = variation; bodyParams.var_price = var_price; } fetch("{{@SITE}}/add-to-cart", { method: 'POST', body: new URLSearchParams(bodyParams) }).then(response => { return response.json(); }).then(data => { //console.log(data); //console.log(data.quantity); if("{{@rs}}"){ $('.side-cart-prod-over-totals').text(`{{@rs}}${data.prodovertotal}`); }else{ $('.side-cart-prod-over-totals').text(`${data.prodovertotal} {{@rs_name}}`); } $('.counts').text(data.quantity); // Call function to add item to side cart addToSideCart(data); // Show or hide elements based on quantity if (data.quantity >= 1) { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); $(".offcanvas .empty-wish-list ").css("display", "none"); $(".offcanvas .total-bottom-part ").css("display", "block"); } else { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); } // Show success message const Toast = Swal.mixin({ toast: true, position: 'center-end', showConfirmButton: false, timer: 1500, timerProgressBar: true, didOpen: (toast) => { toast.addEventListener('mouseenter', Swal.stopTimer) toast.addEventListener('mouseleave', Swal.resumeTimer) } }); Toast.fire({ icon: 'success', title: 'Product added to cart' }); }); }); }); }); document.querySelectorAll(".removecartbtn").forEach(btnCart => { btnCart.addEventListener("click", function(event) { event.preventDefault(); let pid = this.dataset.pid; let $row = $(this).closest("tr"); let qty = $row.find('.cartqty').val(); let variation = this.closest('.single-grid-product').getAttribute('data-sideVarSize'); let var_price = this.closest('.single-grid-product').getAttribute('data-sideVarPrice'); let bodyParams = { 'pid': pid }; if (variation !== null && variation !== '') { bodyParams.variation = variation; bodyParams.var_price = var_price; } //console.log(`Quantity: ${qty}, Product ID: ${pid}`); if (qty > 1) { fetch("{{@SITE}}/remove", { method: 'POST', body: new URLSearchParams(bodyParams) }) .then(response => response.json()) .then(data => { //console.log(data); $('.counts').text(data.quantity); if (data.quantity >= 1) { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); } else { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); } }); } else { Swal.fire({ title: 'Are you sure you want to remove the product from the cart?', text: "You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then((result) => { if (result.isConfirmed) { fetch("{{@SITE}}/remove-prod", { method: 'POST', body: new URLSearchParams({'pid': pid}) }) .then(response => response.json()) .then(data => { //console.log(data); $row.remove(); update_amounts(); $('.counts').text(data.quantity); if (data.quantity >= 1) { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); } else { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); window.location = "{{@SITE}}/cart"; } }).then(() => { Swal.fire( 'Deleted!', 'Your product has been deleted.', 'success' ); }); } }); } }); }); function calculateTotalPrice() { // Get all elements with the class "side-cart-prod-totals" var productTotalElements = document.querySelectorAll('.side-cart-prod-totals'); // Initialize total price var totalPrice = 0; // Loop through each element and add its value to totalPrice productTotalElements.forEach(function(element) { var priceString = element.textContent.replace('{{@rs}}', ''); // Remove the 'Rs.' prefix var price = parseFloat(priceString); // Convert the price to a floating-point number totalPrice += price; // Add the price to totalPrice }); // Return the total price return totalPrice; } document.querySelectorAll(".removecartbtnside").forEach(btnCart => { btnCart.addEventListener("click", function(event) { event.preventDefault(); let pid = this.dataset.pid; let qtyInput = this.closest('.product-item').querySelector('.side-cartqty'); // Get the closest cartqty input field let qty = qtyInput.value; let variation = this.closest('.single-grid-product').getAttribute('data-sideVarSize'); let var_price = this.closest('.single-grid-product').getAttribute('data-sideVarPrice'); let bodyParams = { 'pid': pid }; if (variation !== null && variation !== '') { bodyParams.variation = variation; bodyParams.var_price = var_price; } //console.log(`Quantity: ${qty}, Product ID: ${pid}`); if (qty > 1) { //alert(qty) fetch("{{@SITE}}/remove", { method: 'POST', body: new URLSearchParams(bodyParams) }) .then(response => response.json()) .then(data => { //console.log(data); $('.counts').text(data.quantity); addToSideCart(data); if (data.quantity >= 1) { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); } else { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); } }); } else { fetch("{{@SITE}}/remove-prod", { method: 'POST', body: new URLSearchParams(bodyParams) }) .then(response => response.json()) .then(data => { //console.log(data); if("{{@rs}}"){ $('.side-cart-prod-over-totals').text(`{{@rs}}${data.prodovertotal}`); }else{ $('.side-cart-prod-over-totals').text(`${data.prodovertotal} {{@rs_name}}`); } $(`[data-prods-sidecart-id="${data.cartid}"]`).remove(); var quantitySpan = $('#quantitys'); // Get the span element using jQuery if (parseInt(quantitySpan.text()) ===1) { $(".offcanvas .empty-wish-list ").css("display", "block"); $(".offcanvas .total-bottom-part ").css("display", "none"); } $('.counts').text(data.quantity); if (data.quantity >= 1) { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); } else { $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); } }) } }); }); emptycartButtons = document.querySelectorAll(".emptycartbtn"); emptycartButtons.forEach(btnCart => { btnCart.addEventListener("click", function(event) { event.preventDefault(); Swal.fire({ title: 'Are you sure want empty cart?', text: "You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then((result) => { //console.log(result); if (result.isConfirmed) { fetch("{{@SITE}}/empty", { method: 'POST', }). then(data => { //console.log(data); }); Swal.fire( 'Deleted!', 'Your cart has been deleted.', 'success' ).then(function() { window.location = "{{@SITE}}/cart"; }); } }) }); }); emptyprodButtons= document.querySelectorAll(".emptyprodbtn"); emptyprodButtons.forEach(btnCart => { btnCart.addEventListener("click", function(event) { event.preventDefault(); let pid = this.dataset.pid; Swal.fire({ title: 'Are you sure want remove product from cart?', text: "You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then((result) => { //console.log(result); if (result.isConfirmed) { fetch("{{@SITE}}/remove-prod", { method: 'POST', body: new URLSearchParams({'pid':pid}) }).then(response => { $(this).closest("tr").remove(); update_amounts(); return response.json(); }).then(data => { //console.log(data); $('.counts').text(data.quantity); if(data.quantity>=1){ $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); } else{ $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); window.location = "{{@SITE}}/cart"; } }).then(function() { }); Swal.fire( 'Deleted!', 'Your product has been deleted.', 'success' ); } }) }); }); emptyprodButtons= document.querySelectorAll(".emptyprodbtnside"); emptyprodButtons.forEach(btnCart => { btnCart.addEventListener("click", function(event) { event.preventDefault(); let pid = this.dataset.pid; fetch("{{@SITE}}/remove-prod", { method: 'POST', body: new URLSearchParams({'pid':pid}) }).then(response => { $(this).closest("tr").remove(); update_amounts(); return response.json(); }).then(data => { //console.log(data); if (data.quantity ===null) { $(".offcanvas .empty-wish-list ").css("display", "block"); $(".offcanvas .total-bottom-part ").css("display", "none"); } if("{{@rs}}"){ $('.side-cart-prod-over-totals').text(`{{@rs}}${data.prodovertotal}`); }else{ $('.side-cart-prod-over-totals').text(`${data.prodovertotal} {{@rs_name}}`); } $(`[data-prods-sidecart-id="${data.cartid}"]`).remove(); $('.counts').text(data.quantity); if(data.quantity>=1){ $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "block"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "block"); } else{ $(".header-area .header-middle .header-middle-wrap .header-right .single-btn .header-btn.cart-btn .btn-left .counts").css("display", "none"); $(".mobile-header-area .header-right .header-btn.cart-btn .btn-left .count").css("display", "none"); //window.location = "{{@SITE}}/cart"; } }) }); }); $(document).ready(function(){ update_amounts(); $('.cartqty, .cartprice').on('keyup keypress blur change', function(e) { update_amounts(); }); }); function update_amounts(){ var sum = 0.0; $('#mycartTable > tbody > tr').each(function() { var qty = $(this).find('.cartqty').val(); $(this).find('.cartqty').text(''+qty); //console.log(qty); var price = $(this).find('.cartprice').val(); var amount = (qty*price) sum+=amount; $(this).find('.cartamount').text(''+amount); }); $('.carttotal').text(sum.toFixed(2)); var cartTax = $('.cart-tax').val(); var taxPercentage = (sum * cartTax)/100; var taxInclPrice = sum + taxPercentage; var cartShipping = $('.cart-shipping-cost').val(); $('.cart-taxes').text(taxPercentage.toFixed(2)); if(cartShipping){ var taxShipInclPrice = parseFloat(taxInclPrice) + parseFloat(cartShipping); $('.cart-shipping-costs').text(cartShipping); $('.cart-tax-total').text(taxShipInclPrice.toFixed(2)); }else{ $('.cart-tax-total').text(taxInclPrice.toFixed(2)); } } //----------------for quantity-increment-or-decrement------- var incrementQty; var decrementQty; var plusBtn = $(".cart-qty-plus"); var minusBtn = $(".cart-qty-minus"); var incrementQty = plusBtn.click(function() { var $n = $(this) .parent(".button-container") .find(".cartqty"); $n.val(Number($n.val())+1 ); //console.log($n.val() + 'add'); update_amounts(); }); var decrementQty = minusBtn.click(function() { var $n = $(this) .parent(".button-container") .find(".cartqty"); var QtyVal = Number($n.val()); if (QtyVal > 1) { $n.val(QtyVal-1); //console.log($n.val() + 'dec'); update_amounts(); }else{ $('#mycartTable').closest("tr").prop("disabled", true); } }); $(document).scroll(function(e){ var scrollTop = $(document).scrollTop(); if(scrollTop >= 200){ $('.menu').removeClass('navbar-static-top').addClass('navbar-fixed-top'); $('.menu').css("z-index","100000"); $('.mobile-header-area .header-right .header-btn .btn-left .btn-icon ').css("font-size","4rem") $('.mobile-header-area .header-right .header-btn .btn-left .count ').css("right","-45%") $('.mobile-header-area .header-right .header-btn .btn-left .count ').css("top","20%") } else { $('.menu').removeClass('navbar-fixed-top').addClass('navbar-static-top'); $('.menu').css("z-index","0"); $('.mobile-header-area .header-right .header-btn .btn-left .btn-icon ').css("font-size","2.2rem") $('.mobile-header-area .header-right .header-btn .btn-left .count ').css("right","0px") $('.mobile-header-area .header-right .header-btn .btn-left .count ').css("top","0") } });
{{@universal_btn|raw}}