var products = []; products[214] = ["Thumb Support Wrist Strap", 29.99, "Proton", "Enhance your wrist, hand, and thumb support with our Thumb Support Wrist Strap. Made from breathable, sweat-resistant fabric for comfort throughout the day, this ambidextrous design accommodates both left and right hands.

Preferred by active seniors, fitness enthusiasts, outdoor enthusiasts, and professional athletes, it offers crucial support, stability, and swift recovery.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "access" ] ; products[215] = ["Digital Weight Machine", 39.99, "Proton", "Explore the capabilities of our advanced smart health scale, which surpasses traditional weight measurement. Utilizing state-of-the-art Bioelectric Impedance Analysis (BIA), it rapidly and accurately scans and analyzes your body composition. The scale delivers 14 comprehensive health and fitness insights directly to your smartphone.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "access" ] ; products[216] = ["Medical Stethoscope", 49.99, "Proton", "The medical stethoscope stands as a crucial instrument for healthcare professionals, allowing them to audibly assess vital sounds from the lungs, heart, and stomach. Constructed from lightweight aluminum with a sand-anodized chest piece, it ensures exceptional acoustic sensitivity.

Equipped with PVC 'U' shaped tubes and soft-sealing eartips for added comfort, this stethoscope is relied upon by healthcare experts and serves as a valuable inclusion in any home healthcare kit.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "access" ] ; products[217] = ["Sinus Relief Device", 59.99, "Proton", "A sinus blockage can result in severe headaches, migraines, and a general sense of discomfort. Ensuring clear and allergen-free sinuses is essential for overall well-being. Our Sinus Relief Device offers an efficient solution and is compatible with your chosen decongestant liquid.

Tailored to fit any nasal passage size, when employed according to instructions, it assists in effectively clearing out persistent mucus, allergens, and irritants, potentially offering the relief you seek.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "access" ] ; products[218] = ["Medical Wipes (1000 Pieces)", 9.99, "Proton", "In a world where maintaining cleanliness is a daily requirement, our medical wipes become an essential for all living and working spaces. With a hypoallergenic and soft-textured design, they provide a gentle touch on the skin while serving as highly efficient cleaning agents for surfaces and objects.

These medical wipes are easily dispensed for convenient access, and the package includes a substantial supply of 1000 wipes, ensuring you are well-equipped for any sanitation requirement.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton. If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "access" ] ; products[219] = ["Blood Sugar Test Kit", 79.99, "Proton", "With the increasing prevalence of diabetes, keeping a close watch on your blood sugar and glucose levels is essential, not only for individuals with existing conditions but also for those taking a proactive approach to their health.

Introducing our Portable Blood Sugar Test Kit – a digital device that is both compact and lightweight. This innovative tool offers swift testing, reading, and recording of blood sugar/glucose levels.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "access" ] ; products[220] = ["Medical Supplies Bag", 89.99, "Proton", "Ensuring that your medical supplies and medications are readily accessible at home is crucial, and having an organized system adds to their effectiveness. Introducing our Medical Supplies Bag, a vital organizer for all your at-home medical necessities, offering convenient storage and swift access.

Designed with a smart and compact compartmentalized layout, it keeps everything neatly arranged. This bag is not only lightweight but also water-resistant, making it travel-friendly for your convenience.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "access" ] ; products[221] = ["Forehead Thermometer", 99.99, "Proton", "Say goodbye to the discomfort and inaccuracy of traditional invasive mercury thermometers, especially when dealing with children. Introducing the Infrared Forehead Thermometer – a superior alternative.

With this innovative device, you can simply aim the reader at the forehead and get an accurate body temperature measurement displayed, all without the need for any physical contact.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton. If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "access" ] ; products[222] = ["Health Monitor (With Arm Strap) ", 129.99, "Proton", "Take charge of your well-being with our digital Health Monitor featuring an arm strap for added convenience. This device simplifies the process of measuring, recording, and monitoring crucial health metrics such as heart rate, systolic and diastolic blood pressure, SPO2 levels, and more.

Designed for accuracy and on-the-go ease, this lightweight monitor also offers limited memory for easy review of previous readings. Stay on top of your health journey effortlessly with this comprehensive health monitoring tool.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "access" ] ; products[223] = ["Keto Gum", 1, "Proton", "Keto gum offers a wholesome substitute for conventional gum, mints, and other keto-friendly candies, free from aspartame. Boasting a prolonged flavor experience, our all-natural keto gum facilitates sustained ketosis. Devoid of artificial sweeteners, preservatives, and other synthetic additives, it ensures a healthier chewing experience. The sugar-free nature of this gum promotes saliva production, diminishing plaque and contributing to cavity prevention.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "supplement" ] ; products[224] = ["Keto", 79.99, "Proton", "May help provide optimal nutritional support for the high-fat keto diet, the keto diet supplement is enriched with powerful yet safe ingredients. They may assist in naturally promoting targeted weight management goals.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton. If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "1 Bottle", "supplement" ] ; products[225] = ["Keto", 129.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "2 Bottles", "supplement" ] ; products[226] = ["Keto", 169.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "3 Bottles", "supplement" ] ; products[227] = ["Keto", 179.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "4 Bottles", "supplement" ] ; products[228] = ["Keto", 199.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "5 Bottles", "supplement" ] ; products[229] = ["Blood Sugar", 79.99, "Proton", "Balance your blood sugar naturally with our mulberry and cinnamon powered supplement which may help slow down sugar absorption in the gut, potentially contributing to healthy blood sugar levels. May help improve insulin sensitivity and glucose metabolism and may help support overall metabolic health.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton. If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "1 Bottle", "supplement" ] ; products[230] = ["Blood Sugar", 129.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "2 Bottles", "supplement" ] ; products[231] = ["Blood Sugar", 169.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "3 Bottles", "supplement" ] ; products[232] = ["Blood Sugar", 179.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "4 Bottles", "supplement" ] ; products[233] = ["Blood Sugar", 199.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "5 Bottles", "supplement" ] ; products[234] = ["ACV Gummies", 79.99, "Proton", "Proton feature nutritionally fortified ACV gummies designed to potentially address a variety of health concerns, provide ample nutritional support, and help maintain desired fitness levels.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "1 Bottle", "supplement" ] ; products[235] = ["ACV Gummies", 129.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "2 Bottles", "supplement" ] ; products[236] = ["ACV Gummies", 169.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "3 Bottles", "supplement" ] ; products[237] = ["ACV Gummies", 179.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "4 Bottles", "supplement" ] ; products[238] = ["ACV Gummies", 199.88, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton. If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "5 Bottles", "supplement" ] ; products[239] = ["Detox", 29.99, "Proton", "The detox supplement may help in regularizing bowel movement, supporting digestive health, and promoting nutrition improvement. It is formulated with a fiber-rich blend of Psyllium Husk, Fennel, Cascara Sagrada, Ginger, and other botanicals. Made with natural, plant-based ingredients, our detox supplement is free from harsh chemicals and artificial additives.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "1 Bottle", "supplement" ] ; products[240] = ["Detox", 59.99, "Proton", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton . If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "2 Bottles", "supplement" ] ; products[241] = ["ACV Gum", 1.05, "Proton", "The ACV gum infused with apple cider vinegar extract or flavoring aim to provide the purported health benefits associated with apple cider vinegar, such as improved digestion, weight management support, and blood sugar regulation, in a convenient and portable format. This sugar-free gum offers a refreshing assorted flavor that awakens your taste buds and leaves your mouth feeling fresh.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of Proton __prdname__. If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "supplement" ] ; products[242] = ["Keto Gum & ACV Gum Combo ", 1.1, "Proton", "ACV GumThe ACV gum infused with apple cider vinegar extract or flavoring aim to provide the purported health benefits associated with apple cider vinegar, such as improved digestion, weight management support, and blood sugar regulation, in a convenient and portable format. This sugar-free gum offers a refreshing assorted flavor that awakens your taste buds and leaves your mouth feeling fresh.

Keto GumKeto Gum is an aspartame free chewing gum which may provide a healthier alternative to traditional gum, mints, and other keto candy options. With long-lasting flavor, our natural keto gum makes it easy to stay in ketosis for an extended period. No artificial sweeteners, no preservatives, and other artificial ingredients. Chewing sugarless gum stimulates saliva flow, which may help reduce plaque and helps prevent cavities.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for Proton __prdname__. If you are not completely satisfied with your purchase of Proton __prdname__ at any time, please call (877) 596-9385 or email care@getprotonbrnds.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (EST). You will receive your package within 2-5 business days of payment via USPS First Class Mail. I agree that my credit card charge will appear as Proton.", "", "supplement" ] ; 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 total_gbp = 0; var shipping = 0; var grand_total = 0; //var grand_total_gbp = 0; var sub_total = 0; //var sub_total_gbp = 0; var shippingType = ''; //var prodType = ''; 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)); var prodType = products[prodId][7]; if (prodId != "" && quantity > 0) { if(prodType == "access"){ sub_total = round((quantity * products[prodId][1]), 2); }else{ sub_total = round((products[prodId][1]), 2); } //sub_total_gbp = round((quantity * products[prodId][6]), 2); if(prodType == "access"){ total += (quantity * products[prodId][1]); }else{ total += (products[prodId][1]); } //total += (quantity * products[prodId][1]); //total_gbp +=(quantity * products[prodId][6]) } } total = round(total, 2); //total_gbp = round(total_gbp, 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)); }; // 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); } function replaceAllStr(str, find, rstr) { //return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); //return str.replace(/find/g, '\\$&'); return str.replace(new RegExp(find, "g"), rstr); } //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("

Select Products

 
Browse Products
"); } showTotalPrice(); return false; } else { var items = order.split("|"); var total = 0; var total_gbp = 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 += "
Products QtySub TotalTotal
"; var total = 0; var term_htm =''; 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)); var prodType = products[prodId][7]; if (prodId != "" && quantity > 0) { orderedItems[prodId] = quantity; if(prodType == "access"){ var sub_total = round((quantity * products[prodId][1]), 2); }else{ var sub_total = round((products[prodId][1]), 2); } //var sub_total_gbp = round((quantity * products[prodId][6]), 2); total += sub_total; //total_gbp += sub_total_gbp; termTxt = products[prodId][5]; termTxt = replaceAllStr(termTxt, ' __prc__', products[prodId][1].toFixed(2)); //termTxt = replaceAllStr(termTxt, '__pname__', products[prodId][2]); termTxt = replaceAllStr(termTxt, '__prdname__', products[prodId][0]); term_htm += '' + termTxt + ''; cartHtml += "
" + "
" + "
" + products[prodId][4] + "

" + products[prodId][0] + " " + products[prodId][6] + "

" + "
" + "" + ""+ "
"+ quantity +"
" + "
$" + sub_total.toFixed(2) + "
" + "
$" + sub_total.toFixed(2) + "
" + "
" } } cartHtml += "
"; cartHtml += "
Order Summary
" +"
" +"" +"
" +"
" +"Continue Shopping Empty Cart " +"
"; cartHtml += "
"; if (cartHtml != "") { $("#cartBox").html(cartHtml); $(".trm_1").html(term_htm); } else { $("#cartBox").html(" Loading..."); } return false; } }; var round = function(value, decimals) { return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals); };