var products = []; products[214] = ["Thumb Support Wrist Strap", 29.99, "TrustWell Medical", "The Thumb Support Wrist Wrap is must have in your home first-aid kit for sprains, pain & injuries. It may provided required compression to allay pain and inflammation. Anatomical thumb opening is designed for slight abduction and comfort of the thumb with free movement of thumb and fingers.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[215] = ["Medical Body Fat Caliper", 39.99, "TrustWell Medical", "Looking for fat measurements without the high price of digital devices? This Medical Body Fat Caliper is a great alternative for at-home use. The accurately calibrated device helps in easy & simple measurement of body fat percentage by pinching certain areas of the body to gauge skinfold thickness. ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[216] = ["Medical Stethoscope", 49.99, "TrustWell Medical", "The medical grade stethoscope comes with a machined stainless steel chest piece with a diaphragm diameter of 4.5 cm & bell diameter of 3.2 cm.The high acoustic sensitivity makes it a reliable device of choice for health professionals to listen to heart, lunch & blood pressure sounds. ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[217] = ["Sinus Relief Device", 59.99, "TrustWell Medical", "The Sinus Spraying Device has been designed to work with the internal structure of the nasal cavity to help with irrigation of nasal passage, rinsing the sinuses clean of mucus & irritants. It allows for easy flow of water of decongestant liquid. The one-size-fits all design means it works for you and your entire family. ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[218] = ["Medical Wipes (1000 per pack)", 9.99, "TrustWell Medical", "The medical-grade wipes are great for cleansing, sanitizing & even freshening up. Hypoallergenic in nature they can be used safely on all skin types & even used to sanitize products & surfaces. They come in a convenient dispensing pack to help you keep them ready to use. ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[219] = ["Blood Sugar Test Kit", 79.99, "TrustWell Medical", "A must have device at home for people with blood sugar issues or diabetes, this advanced digital blood sugar test kit can help you measure glucose in an instant. Just prick, place and get an accurate digital reading. Comes with a manual for detailed instruction on how to use. ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[220] = ["Medical Supplies Bag", 89.99, "TrustWell Medical", "The medical supply bag is great for every home - as it lets you keep all your medical & health equipment organized to ensure you can find it in a jiffy when you need it the most. It has separate compartments for devices, apparatuses, medicines & first aid equipment. Built to last & keep your supplies protected - it's padded, waterproof & tear-resistant. ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[221] = ["Forehead Thermometer", 99.99, "TrustWell Medical", "A must have for every household - the infrared thermometer helps you get accurate reading of body temperature in the most accurate, reliable & fast manner. Just point it at the forehead and get the reading that shows in different colors for low, normal & high, The LED screen is bright-lit in the back for easy viewing in the dark. ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[222] = ["Health Monitor (with Arm Strap) ", 129.99, "TrustWell Medical", "The health monitor offers measurement of a wide range of health parameters including heart rate, blood pressure, SPO2 and more. It comes with an easy to strap on arm strap and offers quick and reliable measurement. ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[223] = ["Nutrition E-Book", 1.55, "TrustWell Medical", "The Digital Health Ebook includes information about how to enjoy the best embark and success on your keto journey. It includes tips & tricks to improve results. You can download it and view it on any device of your choice.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[224] = ["Keto", 79.99, "TrustWell Medical", "Enriched with power-packed but safe ingredients, the keto diet supplement capsules may help offer optimum nutritional support to sustain the typical high-fat keto diet and may help promote targeted weight management goals naturally.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[225] = ["Keto", 119.88, "TrustWell Medical", "Our signature high waist leggings with "Butt Up" design gives your body the freedom, shape & appeal - that lets you workout with more comfort, while flattering the way your curves look and feel at the same time.

The fearless orange is vibrant and is sure to get you the eyeballs as you walk by.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[226] = ["Keto", 159.88, "TrustWell Medical", "Our signature high waist leggings with "Butt Up" design gives your body the freedom, shape & appeal - that lets you workout with more comfort, while flattering the way your curves look and feel at the same time.

The green is the latest addition and loved by our fans!", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[227] = ["Keto", 179.88, "TrustWell Medical", "Our signature high waist leggings with "Butt Up" design gives your body the freedom, shape & appeal - that lets you workout with more comfort, while flattering the way your curves look and feel at the same time.

The cool blue is perfect not just for the gym or the beach but even to lounge around in the house.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[228] = ["Keto", 199.88, "TrustWell Medical", "Our gym sets are what we like to call "True Performance Wear" for active ladies that mean business and are not scared of showing it! The Gym Set comes with a long sleeves crop top along with our motion leggings, which are a combination of sexy style, premium comfort & free movement.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[229] = ["Blood Sugar", 79.99, "TrustWell Medical", "The Blood Sugar formula includes a blend of mulberry & cinnamon extract, both of which have been proven to support health blood sugar levels. For best results we recommend using the supplement as directed on the label and include a healthy diet & regular exercise regiment in your daily routine. ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[230] = ["Blood Sugar", 129.99, "TrustWell Medical", "Our gym sets are what we like to call "True Performance Wear" for active ladies that mean business and are not scared of showing it! The Gym Set comes with a long sleeves crop top along with our motion leggings, which are a combination of sexy style, premium comfort & free movement.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[231] = ["Blood Sugar", 189.99, "TrustWell Medical", "Our gym sets are what we like to call "True Performance Wear" for active ladies that mean business and are not scared of showing it! The Gym Set comes with a long sleeves crop top along with our motion leggings, which are a combination of sexy style, premium comfort & free movement.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[232] = ["Blood Sugar", 199.99, "TrustWell Medical", "We are bringing sexy back into the sports-bra, with our low cut and satin feels, while retaining the snug fit, the breathable fabric & complete balance! Whether you are going for a run, working out in the gym, or doing your morning session of yoga, this sports bra will have the right impact on your performance (and even your style quotient)!", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[233] = ["Blood Sugar", 239.99, "TrustWell Medical", "We are bringing sexy back into the sports-bra, with our low cut and satin feels, while retaining the snug fit, the breathable fabric & complete balance! Whether you are going for a run, working out in the gym, or doing your morning session of yoga, this sports bra will have the right impact on your performance (and even your style quotient)!", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[234] = ["ACV Gummies", 79.99, "TrustWell Medical", "Top Truly Brands ACV Gummies presents optimally fortified nourishing ACV gummies that may help address a range of health concerns, offer adequate nutritional assistance and 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 TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[235] = ["ACV Gummies", 119.88, "TrustWell Medical", "Our super comfy bra set - includes our low cut fleece lined bra that is super comfortable and offers complete support when you need it the most. The matching high waist drawstring shorts perfectly complement the sports bra, while giving your legs maximum range of motion during workouts & exercise.

One of our best sellers, we urge you to grab them before they stock out! ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[236] = ["ACV Gummies", 159.88, "TrustWell Medical", "The unique 500 ml. a protein shaker bottle comes with an easy mixer with precision measurements and can hold up to 2 scoops of your favorite protein powder. Its leak proof cap ensures you can carry it without the worry of spills. It is made with non-toxic plastic and is completely BPA free, making it safe for use.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[237] = ["ACV Gummies", 179.88, "TrustWell Medical", "Smart fitness tracker gives you real-time health & fitness insights, tracks your progress & guides you to reach your goals, everyday. Lightweight, water resistant, iOS & Android compatible, the fitness tracker is a must have ally that offers monitoring & motivation on your wrist!", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[238] = ["ACV Gummies", 199.88, "TrustWell Medical", "These unisex gym gloves are perfect to give you the grip and cushion you need in the gym, making the lifts and reps more comfortable. Enabled with dry-fit fabric tech, they keep sweat away.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[239] = ["Detox", 39.99, "TrustWell Medical", "The detox supplement may help regularize bowel movement, may help support digestive health & may help promote nutrition improvement. It is formulated with a fiber-rich blend of Psyllium Husk, Fennel, Cascara Sagrada, Ginger & other botanicals. ", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[240] = ["Detox", 59.99, "TrustWell Medical", "Our leather gym bag is the latest addition to our accessories category. It comes in the perfect black color and gives your gym look a touch of sexy style too!", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__ of TrustWell Medical __pname__. If you are not completely satisfied with your purchase of TrustWell Medical __pname__ at any time, please call 8774705128 or email support@trustwellmedical.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 trustwellmedical.com."]; products[2129] = ["Blood Sugar ( Monthly )", 79.99, "TrustWell Medical", "The Blood Sugar formula includes a blend of mulberry & cinnamon extract, both of which have been proven to support health blood sugar levels. For best results we recommend using the supplement as directed on the label and include a healthy diet & regular exercise regiment in your daily routine. ", "", "By placing your monthly recurring order of __prdname__ TrustWell Medical __pname__, you will be charged $ __prc__ Now and every 30 days thereafter until you cancel your subscription. You will receive an electronic notification 5 to 7 days prior to your transaction and receipt after each successful transaction."]; products[2130] = ["Blood Sugar ( Monthly )", 129.99, "TrustWell Medical", "Our gym sets are what we like to call "True Performance Wear" for active ladies that mean business and are not scared of showing it! The Gym Set comes with a long sleeves crop top along with our motion leggings, which are a combination of sexy style, premium comfort & free movement.", "", "By placing your monthly recurring order of __prdname__ TrustWell Medical __pname__, you will be charged $ __prc__ Now and every 30 days thereafter until you cancel your subscription. You will receive an electronic notification 5 to 7 days prior to your transaction and receipt after each successful transaction."]; products[2131] = ["Blood Sugar ( Monthly )", 189.99, "TrustWell Medical", "Our gym sets are what we like to call "True Performance Wear" for active ladies that mean business and are not scared of showing it! The Gym Set comes with a long sleeves crop top along with our motion leggings, which are a combination of sexy style, premium comfort & free movement.", "", "By placing your monthly recurring order of __prdname__ TrustWell Medical __pname__, you will be charged $ __prc__ Now and every 30 days thereafter until you cancel your subscription. You will receive an electronic notification 5 to 7 days prior to your transaction and receipt after each successful transaction."]; products[1232] = ["Blood Sugar ( Monthly )", 199.99, "TrustWell Medical", "We are bringing sexy back into the sports-bra, with our low cut and satin feels, while retaining the snug fit, the breathable fabric & complete balance! Whether you are going for a run, working out in the gym, or doing your morning session of yoga, this sports bra will have the right impact on your performance (and even your style quotient)!", "", "By placing your monthly recurring order of __prdname__ TrustWell Medical __pname__, you will be charged $ __prc__ Now and every 30 days thereafter until you cancel your subscription. You will receive an electronic notification 5 to 7 days prior to your transaction and receipt after each successful transaction."]; products[1233] = ["Blood Sugar ( Monthly )", 239.99, "TrustWell Medical", "We are bringing sexy back into the sports-bra, with our low cut and satin feels, while retaining the snug fit, the breathable fabric & complete balance! Whether you are going for a run, working out in the gym, or doing your morning session of yoga, this sports bra will have the right impact on your performance (and even your style quotient)!", "", "By placing your monthly recurring order of __prdname__ TrustWell Medical __pname__, you will be charged $ __prc__ Now and every 30 days thereafter until you cancel your subscription. You will receive an electronic notification 5 to 7 days prior to your transaction and receipt after each successful transaction."]; console.log(products); var orderedItems = []; var orderedTotQty = 0; var maxQty = 10; var shipRates = false; var handling = 0; var carturl = "cart.php"; //Funtion adds Items to Cart var addItem = function(itemId, Qty) { 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(false, '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) { 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(); $('#term-' + itemId).remove(); } $.cookie('order', order); $.cookie('orderedTotQty', orderedTotQty); showCart(false, '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)); }; // 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("

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 += "
Order Summary Price
"; cartHtml += "
Order Summary Qty.Sub Total
"; 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)); if (prodId != "" && quantity > 0) { orderedItems[prodId] = quantity; var sub_total = round((quantity * products[prodId][1]), 2); total += sub_total; termTxt = products[prodId][5]; termTxt = replaceAllStr(termTxt, ' __prc__', products[prodId][1].toFixed(2)); termTxt = replaceAllStr(termTxt, '__pname__', products[prodId][0]); termTxt = replaceAllStr(termTxt, '__prdname__', products[prodId][2]); term_htm += '' + termTxt + ''; cartHtml += "
" + "
" + "

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

" + "
" + "" + ""+ "
Qty: "+ quantity +"
" + "
$" + (products[prodId][1]).toFixed(2) + "
" + "
$" + sub_total.toFixed(2) + "
" + "
" } } cartHtml += ""; cartHtml += "
" +"
" +"
    " +"
  • Sub Total: $" + total.toFixed(2) + "
  • " +"
  • Shipping & Handling: $0.00
  • " +"
  • Total: $" + total.toFixed(2) + "
  • " +"
" +"
" +"
" +"
"; +"
"; 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); };