var products = []; products[210] = ["Cropped Yoga Pant", 120, "Magic Fitness", "Looking for ultra-comfy bottoms for gentle yoga?We chose soft cotton and a loose fit for your practice to help you champion the most challenging asanas.

Stretchy, soft cropped bottoms made of cotton grown organically. The high-rise turn-down waistband supports the abs and fits any figure. Also suitable for pregnant women.", "", "Cropped Yoga Pant"]; products[213] = ["Short Sleeved Hiking T-Shirt", 75, "Magic Fitness", "Discover the women’s hiking t-shirt that is breathable, odourless, lightweight and designed to resist abrasion from your backpack on mountain hikes. The quick-drying & sweat resistant design keeps you comfortable while offering natural odor management.", "", "Short Sleeved Hiking T-Shirt"]; products[223] = ["Long Sleeved T-Shirt ", 90, "Magic Fitness", "Our hiking team eco- designed this stretchy, moisture wicking long-sleeved t-shirt for regular hikes. You will also like the recycled polyester thread main fabric. Its rear collar will protect the back of your neck from the sun and any friction from the backpack. Perfect for mild summers & winters, this is a must have in your fitness wardrobe.", "", "Long Sleeved T-Shirt "]; products[224] = ["Surfing Wetsuit ", 95, "Magic Fitness", "Designed for those who love to catch the waves, the surfing wetsuit is the perfect blend of comfort, performance & protection. It offers a light-padded design to prevent any injuries if the waves get rough, while the fabric keeps you comfortable even after hours in the water. It comes with an easy to take on and off back zipper for form fitting. Great for body", "", "Surfing Wetsuit "]; products[225] = ["Bikini Bottoms", 45, "Magic Fitness", "The hottest product of the season, these printed bottoms offer comfort, style & function. They are a hot favorite amongst female surfers, paddle boarders & even the spring break beach bums! They come with a concealed drawstring to keep it in place even when the waves get rough. Grab these before they stock out.", "", "Bikini Bottoms"]; products[226] = ["Beach Boardshorts", 88, "Magic Fitness", "These short women's boardshorts are designed to be worn over your swimsuit for all water-based activities; they have an elasticated waistband and drawstring, and are water repellent for faster drying. They are perfect for water sports, beach swims & just lounging around too!", "", "Beach Boardshorts"]; products[227] = ["Surfing T-Shirt ", 75, "Magic Fitness", "Specially crafted for female water sports enthusiasts the women’s UV-resistant short-sleeved T-shirts offer protection from the sun, even in the water, and to limit irritation when in contact with the surfboard, paddle board, jetski & more. It offers a close fit for greater stability in the waves.", "", "Surfing T-Shirt "]; products[228] = ["Swimsuit Crop Top ", 55, "Magic Fitness", "A must have for beach-lovers, this crop top swimsuit top offers complete coverage & supports the bust at the front, while leaving the back & shoulders open for comfort and oodles of the oomph factor! The adjustable crossed straps & removeable bust pads let you customize it to your figure.", "", "Swimsuit Crop Top "]; products[229] = ["Workout Tights ", 125, "Magic Fitness", "Designed for women who love their long runs & jogs the workout tights are perfect for hot or mild weather. Made with super soft fabric, they are ventilated on two sides, and come with 2 zipped pockets to store your keys and smartphones. What makes these tights uber comfortable is the seamless design between the legs to reduce chafing.", "", "Workout Tights "]; products[230] = ["Long Sleeved T-Shirt", 90, "Magic Fitness", "This t-shirt was specially developed for women who like to get a run all year round, no matter rain or shine. The long sleeved tee comes with soft, anti-UV fabric to offer protection from the sun, while the moisture wicking fabric gives you added comfort. ", "", "Long Sleeved T-Shirt"]; products[239] = ["Cardio Sports Bra ", 65, "Magic Fitness", "A light support sports bra is a must for low-impact fitness activities. The ultra-soft fabric wicks away perspiration. It has a sporty look that was made for cardio! You will get full coverage, uber comfort & complete range of motion during your most intense workout sessions.", "", "Cardio Sports Bra "]; products[240] = ["Surfing Swimsuit", 105, "Magic Fitness", "This 1-piece, with cups, designed for surfing provides significant coverage at the front to protect the surfer from chafing. With a very open back, it leaves the shoulders free to paddle. The super cool design makes it a must have for the coming summer season for every reason! ", "", "Surfing Swimsuit"]; products[245] = [" ", 55, "Magic Fitness", "", "", " "]; products[246] = ["", 40.91, "Magic Fitness", "", "", " "]; products[247] = [" ", 40.91, "Magic Fitness", "", "", " "]; products[247] = ["", 40.91, "Magic Fitness", "", "", " "]; products[211] = ["Water Bottle", 15, "Magic Fitness", "A BPA-Free water bottle that's perfect for all your fitness activities - including the gym, sports, cycling & more. Ergonomic grip, lightweight & durable - it's the last workout bottle you will ever need! It has a 800 ML capacity & comes with a no-spill cover.", "", "Water Bottle"]; products[221] = ["Biking Gloves", 55, "Magic Fitness", "A must have for all cycling enthusiasts, these tear & abrasion resistant gloves offer super durability. They are made of conductive material which means the gloves can be used with your smartphone screen. It is super lightweight & just weighs 45 grams.", "", "Biking Gloves"]; products[222] = ["Hiking Belt", 30, "Magic Fitness", "The perfect belt bag for long-duration hikers, runners & cyclists - it helps secure your belongings while also being waterproof. Its adjustable to fit any waist size & also clips with ease. ", "", "Travel Belt Bag"]; products[231] = ["Massage Roller", 45, "Magic Fitness", "The super soft foam massage & recovery roller is perfect for cross training mobility exercises. It comes very handy to recover from aches, pains & muscle tears as well. Made with durable material - it does not lose its shape even after repeated & intense use. ", "", "Massage Roller"]; products[232] = ["Wrist Sweatband ", 15, "Magic Fitness", "Highly sweat absorbing material with quick dry capability makes it ideal for regular usage for long periods of time in hot and humid conditions.", "", "Wrist Sweatband "]; products[233] = ["Knee Compression Sleeves", 35, "Magic Fitness", "Knee Compression Sleeves will provide the optimal support, relief, and comfort to your knees and in-turn to your entire lower body by improving blood flow. They are great for relief, recovery & performance when you are working out or engaging in your favorite sport.", "", "Soft Knee Support"]; products[241] = ["Men's Running Stopwatch", 175, "Magic Fitness", "Designed for passionate runners for whom every second matters, the stopwatch helps you track your pace, distance, cadence, run splits & more. It also is great if you are looking to measure your performance at interval training. Priced right, this is a must have for any fitness enthusiasts, grab one before they stock out again!", "", "Gym Mat Black"]; products[242] = ["Fitness Bag", 80, "Magic Fitness", "Our team developed this fold-down sports bag for carrying your fitness outfit and gear to and from your workout. This foldable and ultra-light bag is a must-have. You can take it anywhere as it takes up next to no space and it is just what you need when playing sport.", "", "Fitness Bag"]; products[243] = ["Smart Weighing Scale", 55, "Magic Fitness", "The next-generation smart health scale - does more than measure your weight, it uses breakthrough Bioelectric Impedance Analysis (BIA) to scan & analyze your body's composition, delivering 14 health & fitness insights to your smartphone quickly & accurately.", "", "Digital Weight Scale"]; products[244] = ["Cycling LED Light", 10, "Magic Fitness", "We created this soft mat to help you ease into learning yoga. Nature is present every time you step on the mat. The comfortable thickness lets you reconnect to your senses.", "", "Cycling LED Light"]; products[212] = ["Long Sleeves Jersey", 88, "Magic Fitness", "Developed for the colder conditions, these long sleeve jerseys offer optimum warmth & compression to keep you performing at your best. The thermal regulation technology helps your body adapt to the temperatures better, while the moisture wicking fabric keeps you comfortable. ", "", "Long Sleeves Jersey "]; products[214] = ["Short-Sleeved Cycling Jersey", 68, "Magic Fitness", "Developed for high performance cyclists who take on long trips & demanding competitions, the short sleeved cycling jersey is the perfect choice. The ultra-soft & moisture wicking fabric makes it very comfortable, while the fitted cut ensures natural compression. IT includes merino wool inserts that limit odor. The jersey is sure to make you look stylish both on and of the bike! ", "", "Short-Sleeved Cycling Jersey"]; products[215] = ["Surfing Wetsuit ", 105, "Magic Fitness", "Designed for those who love to catch the waves, the surfing wetsuit is the perfect blend of comfort, performance & protection. It offers a light-padded design to prevent any injuries if the waves get rough, while the fabric keeps you comfortable even after hours in the water. It comes with an easy to take on and off back zipper for form fitting. Great for body.", "", "Surfing Wetsuit "]; products[216] = ["Trekking Jacket", 135, "Magic Fitness", "The most comfortable padded jacket is a hot seller when it comes to hiking & trailing enthusiasts. It offers complete protection, thermal regulation, and moisture wicking. It is also super compact and fits into its sleek case and your backpack. Comes in the classy black color. Also has two zipped pockets to secure your belongings.", "", "Trekking Jacket"]; products[217] = ["Running Tank Top", 95, "Magic Fitness", "A must-have in your workout wardrobe, this super-versatile tank top is great for runs, hikes, workouts & even lounging. It is made with superior moisture-wicking fabric to keep you comfortable while the sleeveless design gives you complete freedom of motion along with the look to enjoy those massive pumps too! ", "", "Running Tank Top"]; products[217] = ["Hiking Cropped Pants", 70, "Magic Fitness", "Are you looking for shorts for your adventures into the wild? Our cropped pants model is both comfortable and practicable, making it ideal for your walks across flatter terrain - without cramping your style! They come with multiple pockets to secure your belongings, store your energy gels & granola bars on those long hikes too.", "", "Hiking Cropped Pants"]; products[219] = ["Activewear Shorts", 50, "Magic Fitness", "These absolutely trendy shorts are great for anything fitness-related, workouts, running, cycling, & even a round of tennis! They are super comfortable to wear, and ensure you grab those eyeballs when you walk with them on too!", "", "Activewear Shorts"]; products[220] = ["Padded Cycling Shorts", 155, "Magic Fitness", "Perfect for heavy duty cycling in the summers, these padded shorts offer superior comfort, while ensuring no more painful bum symptoms after long rides. The shorts come with flat seams, which prevents rubbing and chafing. The foam pads absorb vibrations while the straps provide great hold.", "", "Padded Cycling Shorts"]; products[220] = ["Surfing Wetsuit ", 105, "Magic Fitness", "The Surfing Wetsuit are a great alternative to trunks, in case you are looking for something lightweight, comfortable & versatile - that works for the pool and the beach as well. The shorts-style cut guarantees good freedom of movement & the built-in-briefs ensure total comfort during use.", "", "Surfing Wetsuit "]; products[235] = ["Basketball Shorts", 45, "Magic Fitness", "The best-in-class shorts are perfect to play some serious ball on the streets or a pro-court! Super lightweight, they weigh just 165 grams and come with ventilation zones to keep you dry and comfortable. It also comes with 2 absorbent zones for wiping your hands dry between games! ", "", "Basketball Shorts"]; products[236] = ["Gym Shorts", 55, "Magic Fitness", "Featuring the perfect drop cut design, these shorts are amazing for gym workouts, yoga, runs & even demanding gymnastics! They offer the maximum freedom of movement and flexibility, while offering natural ventilation. ", "", "Gym Shorts"]; products[237] = ["Running Shorts", 55, "Magic Fitness", "Developed for mid & long distance running, these running shorts with built-in carrying capacity to reduce chafing while you run. Includes 5 pockets to carry small bottles, smart phones & more - giving you complete independence.", "", "Running Shorts"]; products[238] = ["Compression T-Shirt", 85, "Magic Fitness", "", "", ""]; console.log(products); var orderedItems = []; var orderedTotQty = 0; var maxQty = 10; var shipRates = false; var handling = 0; var carturl = "cart3.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).size() == 1) { $('#prow-' + 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-"]').size() > 0) { $('[id^="prow-"]').each(function(){ $(this).remove(); }); } 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); } //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-"]').size() == 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); //console.log('showFullCart'); //console.log(showFullCart); 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 QtyUnit PriceTotal
"; 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] + ""+ quantity +"

" + "
" + "" + ""+ "
"+ 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); $(".cart-box").html(cartHtml); } else { $("#cartBox").html(" Loading..."); $(".cart-box").html('You have not selected any product... '); } return false; } }; var round = function(value, decimals) { return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals); };