var products = []; products[210] = ["Portable Utensils Set", 6.97, "Fun Adventure Shop", "

Experience the perfect blend of convenience and eco-friendliness with our Portable Utensil Set. Made from high-quality, rust-resistant, food-grade stainless steel, these reusable utensils may help you enjoy meals sustainably while maintaining durability and safety. Their smooth edges and timeless design make them ideal for everyday use, travel, picnics, camping, or any on-the-go dining. Lightweight and compact, this set may help you reduce waste and stay prepared for any meal, whether you're at home, outdoors, or exploring new destinations.

", "", "Qty 1"]; products[211] = ["Portable Utensils Set", 9.97, "Fun Adventure Shop", "", "", "Qty 2"]; products[212] = ["Portable Utensils Set", 13.47, "Fun Adventure Shop", "", "", "Qty 3"]; products[213] = ["Collapsible Bowl With Lid", 14.97, "Fun Adventure Shop", "

Our Collapsible Bowls with Lids may help simplify your food storage needs with their high-quality, eco-friendly design. Made from premium, non-toxic, and BPA-free silicone, these versatile bowls are perfect for everything from meal prep to leftovers, whether you're at home, camping, or on the road. Their collapsible design saves space, making them ideal for RV organization, camping kitchens, or even everyday use.

", "", "Qty 1"]; products[214] = ["Collapsible Bowl With Lid", 19.97, "Fun Adventure Shop", "", "", "Qty 2"]; products[215] = ["Collapsible Bowl With Lid", 24.97, "Fun Adventure Shop", "", "", "Qty 3"]; products[216] = ["Camping Cookware", 29.97, "Fun Adventure Shop", "

This Highest Quality Non-Toxic Anodized Aluminum Camping Cookset may help you elevate your outdoor cooking experience with its durable, lightweight, and efficient design. Built to last, the cookset conducts heat quickly, making it perfect for preparing meals on the go, whether you're a solo hiker, a scout, or a family camper. Its compact, collapsible design may help you save space in your backpack, while the easy-to-clean materials ensure hassle-free maintenance.

", "", "Qty 1"]; products[217] = ["Camping Cookware", 59.97, "Fun Adventure Shop", "", "", "Qty 2"]; products[218] = ["Camping Cookware", 97.48, "Fun Adventure Shop", "", "", "Qty 3"]; products[219] = ["Sleeping Bag", 39.97, "Fun Adventure Shop", "

These Sleeping Bags for Adults may help you stay comfortable and prepared on any outdoor adventure, from camping and hiking to trekking and couch surfing. Designed for year-round use, they are perfect for summer camps, winter getaways, or even as an emergency blanket in your vehicle. Made with ultra-light, high-quality materials and a super-soft inner lining, they may help you enjoy the perfect balance of durability and comfort.

", "", "Qty 1"]; products[220] = ["Sleeping Bag", 129.97, "Fun Adventure Shop", "", "", "Qty 4"]; products[221] = ["Camping Tent", 89.98, "Fun Adventure Shop", "

A camping tent is a portable shelter made of fabric stretched over a frame of poles, offering protection from the elements during outdoor adventures. It provides a temporary home in nature, allowing campers to sleep comfortably and securely. Tents come in various sizes and designs, catering to solo travelers, couples, families, and different camping conditions. Setting up a tent involves assembling the poles, securing the fabric, and staking it to the ground for stability. A good tent is essential for a safe and enjoyable camping experience, shielding against rain, wind, insects, and providing a sense of privacy in the wilderness.

", "", "Qty 1"]; products[222] = ["Camping Tent", 169.97, "Fun Adventure Shop", "", "", "Qty 2"]; products[223] = ["Foldable Camping Chair", 49.97, "Fun Adventure Shop", "

This multi-functional outdoor chair may help you stay comfortable and organized on your next adventure. With its heavy-duty steel frame and durable fabric, it may support a substantial weight, making it perfect for tailgates, camping, and other events. The chair is designed with several convenient features, including an insulated armrest cooler for your drinks, a built-in wine glass holder, and a large back mesh storage pouch for your essentials. Plus, it sets up in seconds, so you can start relaxing right away.

", "", "Qty 1"]; products[224] = ["Foldable Camping Chair", 119.97, "Fun Adventure Shop", "", "", "Qty 3"]; products[225] = ["Foldable Camping Chair", 159.97, "Fun Adventure Shop", "", "", "Qty 4"]; products[226] = ["Bottle Cooler", 16.94, "Fun Adventure Shop", "

This double-walled, vacuum-insulated stainless steel beverage holder may help keep your drinks cold. It's designed to fit a variety of cans and bottles—including 12 oz and 16 oz cans, and 12 oz bottles—and is made of durable 18/8 stainless steel. Simply screw off the top, insert your drink, and screw the top back on. The powder-coated finish makes it a great gift for any occasion.

", "", "Qty 1"]; products[227] = ["Bottle Cooler", 21.94, "Fun Adventure Shop", "", "", "Qty 2"]; console.log(products); var orderedItems = []; var orderedTotQty = 0; var maxQty = 10; var shipRates = false; var handling = 0; var carturl = "cart.php"; // Function to check item exists in cart var checkItemExists = function(itemId) { var order = $.cookie('order'); if (!order) { return false; } else { var itemExists = false; var items = order.split("|"); order = ""; for (var i = 0; i < items.length; i = i + 1) { var position = items[i].indexOf("-"); var prodId = items[i].substring(0, position); var quantity = parseInt(items[i].substring(position + 1)); if (order != "") { order += "|"; } if (prodId == itemId) { return true; } } } return false; } //Funtion adds Items to Cart var addItem = function(itemId, Qty, showFullCart) { if (typeof showFullCart === "undefined") { showFullCart = false; } orderedTotQty = $.cookie('orderedTotQty'); if (!orderedTotQty) { orderedTotQty = 0; } Qty = parseInt(Qty); if(Qty > maxQty) { alert("Maximum " + maxQty + " of this product can be selected in a single order"); return false; } var order = $.cookie('order'); if (!order) { order = itemId + "-" + Qty; orderedItems[itemId] = Qty; } else { var itemExists = false; var items = order.split("|"); order = ""; for (var i = 0; i < items.length; i = i + 1) { var position = items[i].indexOf("-"); var prodId = items[i].substring(0, position); var quantity = parseInt(items[i].substring(position + 1)); if (order != "") { order += "|"; } if (prodId == itemId) { alert("Product already exist in cart"); return false; if((quantity + Qty) > maxQty) { alert("Maximum " + maxQty + " of this product can be selected in a single order"); return false; } quantity += Qty; order += prodId + "-" + quantity; itemExists = true; } else { order += prodId + "-" + quantity; } orderedItems[prodId] = quantity; } if (!itemExists) { if (order != "") { order += "|"; } order += itemId + "-" + Qty; orderedItems[itemId] = Qty; } } orderedTotQty = parseInt(orderedTotQty); orderedTotQty += Qty; $('.cartqty').html(orderedTotQty); $.cookie('order', order); $.cookie('orderedTotQty', orderedTotQty); var url = window.location.pathname; var filename = url.substring(url.lastIndexOf('/') + 1); if (filename == carturl) { showCart(showFullCart, 'add', itemId); } else { $(location).attr('href', carturl); } }; //Funtion decrements Items to Cart var removeItem = function(itemId, Qty) { Qty = parseInt(Qty); var order = $.cookie('order'); if (!order) { orderedItems[itemId] = 0; refreshRow(itemId); } else { var items = order.split("|"); order = ""; for (var i = 0; i < items.length; i = i + 1) { var position = items[i].indexOf("-"); var prodId = items[i].substring(0, position); var quantity = parseInt(items[i].substring(position + 1)); if (prodId == itemId) { quantity -= Qty; if (quantity > 0) { if (order != "") { order += "|"; } order += prodId + "-" + quantity; } itemExists = true; orderedItems[prodId] = quantity; refreshRow(itemId); } else { if (order != "") { order += "|"; } order += prodId + "-" + quantity; orderedItems[prodId] = quantity; } } } orderedTotQty -= Qty; $('.cartqty').html(orderedTotQty); $.cookie('order', order); $.cookie('orderedTotQty', orderedTotQty); var url = window.location.pathname; var filename = url.substring(url.lastIndexOf('/') + 1); if (filename == carturl) { showCart(false, 'remove', itemId); } else { $(location).attr('href', carturl); } }; //Funtion sets Item quantity on the Cart var setItemQty = function(itemId, Qty) { Qty = parseInt(Qty); if(Qty > maxQty || Qty < 0) { return false; } var order = $.cookie('order'); orderedTotQty = 0; if (!order) { orderedItems[itemId] = 0; } else { var items = order.split("|"); order = ""; for (var i = 0; i < items.length; i = i + 1) { var position = items[i].indexOf("-"); var prodId = items[i].substring(0, position); var quantity = parseInt(items[i].substring(position + 1)); if (prodId == itemId) { quantity = Qty; if (order != "") { order += "|"; } order += prodId + "-" + quantity; itemExists = true; } else { if (order != "") { order += "|"; } order += prodId + "-" + quantity; } orderedItems[prodId] = quantity; orderedTotQty += quantity; } } $('.cartqty').html(orderedTotQty); $.cookie('order', order); $.cookie('orderedTotQty', orderedTotQty); var url = window.location.pathname; var filename = url.substring(url.lastIndexOf('/') + 1); if (filename == carturl) { showCart(false, 'set', itemId); } else { $(location).attr('href', carturl); } }; var removeRowItem = function(itemId, showFullCart) { if (typeof showFullCart === "undefined") { showFullCart = false; } var order = $.cookie('order'); if (!order) { orderedTotQty = 0; } else { var items = order.split("|"); order = ""; orderedTotQty = 0; orderedItems = null; orderedItems = new Array(); for (var i = 0; i < items.length; i = i + 1) { var position = items[i].indexOf("-"); var prodId = items[i].substring(0, position); var quantity = parseInt(items[i].substring(position + 1)); if (prodId == itemId) { } else { if (order != "") { order += "|"; } order += prodId + "-" + quantity; orderedTotQty += quantity; orderedItems[prodId] = quantity; } } } if($('#prow-' + itemId).length == 1) { $('#prow-' + itemId).remove(); } $.cookie('order', order); $.cookie('orderedTotQty', orderedTotQty); showCart(true, 'removerow', itemId); }; //Emptying the cart var emptyCart = function() { var order = $.cookie('order'); order = ""; orderedTotQty = 0; orderedItems = null; orderedItems = new Array(); $.cookie('order', order); $.cookie('orderedTotQty', orderedTotQty); if($('[id^="prow-"]').length > 0) { $('[id^="prow-"]').each(function(){ $(this).remove(); }); } $('.trm_1').hide(); showCart(false, 'empty'); }; //Displaying the cart items & calculations function showTotalPrice() { var cartHtml = ""; var total = 0; var shipping = 0; var grand_total = 0; var sub_total = 0; var shippingType = ''; var order = $.cookie('order'); orderedTotQty = $.cookie('orderedTotQty'); if($('#shippingCountry').val() == '') { shippingType = ''; } else if($('#shippingCountry').val() == 'US') { shippingType = 'US'; } else { shippingType = 'INTERNATIONAL'; } if (!order) { orderedTotQty = 0; } else { var items = order.split("|"); if(shipRates) { shipping = shipRates * 1.0; } for (var i = 0; i < items.length; i = i + 1) { var position = items[i].indexOf("-"); var prodId = items[i].substring(0, position); var quantity = parseInt(items[i].substring(position + 1)); if (prodId != "" && quantity > 0) { sub_total = round((quantity * products[prodId][1]), 2); total += (quantity * products[prodId][1]); } } total = round(total, 2); } var snh = shipping + handling; //if(shipping == 0) { // snh = shipping; //} console.log(snh); grand_total = total + snh; $('#total-price').html('$ ' + total.toFixed(2)); $('#shipping-price').html('$ ' + snh.toFixed(2)); $('#grand-total').html('$ ' + grand_total.toFixed(2)); $(".show-tot").html('$'+total.toFixed(2)); }; // Refresh row content with updated quantity / price for a product function refreshRow(pid) { pid = parseInt(pid); quantity = orderedItems[pid]; sub_total = round((quantity * products[pid][1]), 2); $('#prow-' + pid + ' .tot-price').html('$' + sub_total.toFixed(2) + ' USD'); $('#prow-' + pid + ' .qtybox').val(quantity); $('#prow-' + pid + ' .dispqty').html(quantity); } //Displaying the cart items & calculations function showCart(showFullCart, act, itm) { var cartHtml = ""; var order = $.cookie('order'); orderedTotQty = $.cookie('orderedTotQty'); if (!order) { orderedTotQty = 0; if($('[id^="prow-"]').length == 0) { $("#cartBox").html("

You have not selected any product...

  Browse Products"); } showTotalPrice(); return false; } else { var items = order.split("|"); var total = 0; var shipping = 0; var grand_total = 0; orderedTotQty = parseInt(orderedTotQty); if (typeof showFullCart === "undefined") { return false; } else if(showFullCart == false) { if ((typeof act !== "undefined") && (typeof itm !== "undefined")) { if((act == 'add' || act == 'set' || act == 'remove') && itm > 0) { refreshRow(itm); } else if(act == 'removerow' && itm > 0) { itm = parseInt(itm); } } showTotalPrice(); return false; } orderedItems = null; orderedItems = new Array(); cartHtml += "
ProductPrice Qty.Total
"; var total = 0; for (var i = 0; i < items.length; i = i + 1) { var position = items[i].indexOf("-"); var prodId = items[i].substring(0, position); var quantity = parseInt(items[i].substring(position + 1)); if (prodId != "" && quantity > 0) { orderedItems[prodId] = quantity; var sub_total = round((quantity * products[prodId][1]), 2); total += sub_total ; cartHtml += "
" + "
" + "

" + products[prodId][4] + " " + products[prodId][0] + " " + products[prodId][5] + "

" + "
" + "" + "" + "
$" + (products[prodId][1]).toFixed(2) + "
" + "
" + quantity + "
" + "
$" + sub_total.toFixed(2) + "
" + "
" } } cartHtml += ""; cartHtml += "
" +"
" +"" +"
" +"
"; cartHtml += "
" +"Continue Shopping Empty Cart Proceed To Checkout
" +"
"; if (cartHtml != "") { $("#cartBox").html(cartHtml); $(".show-tot").html('$'+total.toFixed(2)); } else { $("#cartBox").html(" Loading..."); } return false; } }; var round = function(value, decimals) { return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals); };