var products = []; products[210] = ["Seamless Leggings", 125, "Sync Up Fitness", "Crafted with figure skaters & gymnasts in mind, these super stretch seamless leggings offer the most when it comes to freedom of movement. The body flattering fit gives you the perfect shape, while the moisture wicking fabric ensures you stay dry and comfortable. Perfect for workouts, sports, runs and ofcourse high performance gymnastics & figure skating!", "", "Running Skort"]; products[213] = ["Cottong Fitness Leggings", 125, "Sync Up Fitness", ""Style" and "freedom of movement" were the 2 requirements that guided our designers when creating these 7/8 leggings that you can wear for sport and much more! These 7/8 leggings are THE perfect way to flatter your ankles. And while they look great, that doesn't mean they're any less comfy, thanks to their stretchy fabric. It's like having a second skin!", "", "Tennis Skirt"]; products[223] = ["Cotton Yoga Leggings", 130, "Sync Up Fitness", "Looking for ultra-comfy bottoms for gentle yoga? Our team chose soft cotton and a slim fit for your practice. Comfortable leggings made from warm sustainable cotton. The high-rise turn-down waistband supports the abs and fits any figure, even pregnant women.", "", "Fitness Tracks"]; products[224] = ["Fitness Dance Leggings", 120, "Sync Up Fitness", "Stylish leggings designed for fitness that give you freedom of movement, with an adjustable waistband you can wear up or down.. Wear them however you like! These leggings have a waistband you can wear up or down - whichever way you feel most comfortable. Plus, they come in a trendy print.", "", "Running Tracks"]; products[225] = ["Comfort Workout Tracks", 125, "Sync Up Fitness", "These leggings are made from super soft & stretchy fabric that offers flexibility & breathability. They are great for workouts, runs, sports training & even double up as your lounge wear. The trendy 3 stripes down the side design makes it a timeless classic to have in your fitness collection.", "", "7/8 Gym Leggings"]; products[226] = ["Trekking Fleece Tights", 115, "Sync Up Fitness", "Our team of mountain trekking enthusiasts developed these recycled polyester tights for nights bivouacking or under shelter.. Warm, this fleece undergarment is also very soft. It’s perfect for spending a pleasant night trekking. Enjoy its light weight too.", "", "High Waist Gym Leggings"]; products[227] = ["Workout Sports Bra", 95, "Sync Up Fitness", "The seamless knitted sports bra is crafted for your most intense workout sessions including gymming, runs, sports & more. This functional gymnastics sports bra offers total comfort, softness and freedom of movement. Lined for increased opacity, with crossover straps for an athletic style.", "", "Workout Sports Bra"]; products[228] = ["Front Zip Sports Bra", 85, "Sync Up Fitness", "We are passionate about cardio fitness and designed this product for high-impact cardio fitness activities.. A sports bra with superior support and a front zip to make it easier to put on. Suitable for all activities, even intense ones. For more comfort: adjustable straps and built-in foam.", "", "Shaping Gym Leggings"]; products[229] = ["Compression Sports Bra", 95, "Sync Up Fitness", "Double-lined with the highest performing sweat-wicking fabric known to sport, it incorporates breathability with an uber-supportive underband and bracing shoulder straps, this sports bra is made for high performance and winning style.", "", "Compression Sports Bra"]; products[230] = ["Workout Jacket ", 135, "Sync Up Fitness", "The basic yet quintessential workout jacket to keep you warm during & after your workout session. Made with super breathable & moisture wicking material is also a hot favorite for long distance runners & mountain hiking enthusiasts.", "", "Anti-Chafing Gym Shorts"]; products[239] = ["Rain Jacket", 140, "Sync Up Fitness", "A must-have for fitness enthusiasts who like to stay on track no matter rain or shine. The waterproof jacket keeps you sheltered from the rain while the thermal insulation technology also ensures it doubles up as a warmer. The neon color offers improved night-visibility on those dark trails too.", "", "Warm Ski Jacket"]; products[240] = ["Ski Jacket", 150, "Sync Up Fitness", "Perfect to make the most of the skiing season, the Ski Jacket offers warmth, comfort & freedom of movement combined. It comes with adjustable drawstrings & enough compact pockets to store whatever you may have to. The jacket is also great for winter mountain hiking & trails.", "", "Cotton Gym Jacket"]; products[245] = ["Compression Sports Bra ", 95, "Sync Up Fitness", "Double-lined with the highest performing sweat-wicking fabric known to sport, it incorporates breathability with an uber-supportive underband and bracing shoulder straps, this sports bra is made for high performance and winning style.", "", "Compression Sports Bra "]; products[246] = ["Compression Sports Bra ", 95, "Sync Up Fitness", "Double-lined with the highest performing sweat-wicking fabric known to sport, it incorporates breathability with an uber-supportive underband and bracing shoulder straps, this sports bra is made for high performance and winning style.", "", "Compression Sports Bra "]; products[247] = ["Compression Sports Bra ", 95, "Sync Up Fitness", "Double-lined with the highest performing sweat-wicking fabric known to sport, it incorporates breathability with an uber-supportive underband and bracing shoulder straps, this sports bra is made for high performance and winning style.", "", "Compression Sports Bra "]; products[247] = ["Compression Sports Bra", 95, "Sync Up Fitness", "Double-lined with the highest performing sweat-wicking fabric known to sport, it incorporates breathability with an uber-supportive underband and bracing shoulder straps, this sports bra is made for high performance and winning style.", "", "Compression Sports Bra "]; products[211] = ["Pull Up Bar", 70, "Sync Up Fitness", "Perfect for straight training this pull-up bar is great for easy bodyweight workouts at home. Want a bar that's quick to put up? Try our Pull-Up Bar, it can be installed without any screws for an upper body workout in a flash.", "", "Pull Up Bar"]; products[221] = ["Women's Fitness Bag", 50, "Sync Up Fitness", "Fashion-fitness inspired fitness bags give you all the practical features you need. The padded fabric gives it an XL look that's bang on trend. It's got loads of details that make it ultra-practical: pockets, a zip that can be used with a padlock, and an inner removable pouch.", "", "Women's Fitness Bag"]; products[222] = ["Simple Stepper", 40, "Sync Up Fitness", "This stepper was designed for all your choreographed or functional step workouts combining cardio and strength training exercises. Its compact design makes the stepper perfect for home workouts. We have made sure it grips the floor really well and remains stable so that you can enjoy a great workout.", "", "Simple Stepper"]; products[231] = ["Gym Duffle Bag", 50, "Sync Up Fitness", "Our passionate fitness team has developed this sports bag for carrying your essentials. A clever, practical bag you can take anywhere.. An ultra-compact barrel bag for carrying your essentials. You can take it anywhere as it takes up next to no space and it is just what you need when playing sport. ", "", "Gym Duffle Bag"]; products[232] = ["Ab Workout Wheel", 30, "Sync Up Fitness", "Our teams have designed this ab wheel to be taken anywhere so that you can work all your ab muscles at any time.. Allows you to work out your abs or obliques on your knees or on your toes, in stable or unstable modes. You'll continue to find this abs wheel useful as your fitness level increases.", "", "Ab Workout Wheel"]; products[233] = ["Training Knee Brace", 35, "Sync Up Fitness", "Our designers have developed this sock for your hikes in extremely cold weather. Enjoy the snow with the warmest in the range.. These ultra-warm socks will give you maximum warmth thanks to the foot knitted in 100% Merino wool. The ventilation in the instep promotes moisture transfer and drying.", "", "Training Knee Brace"]; products[241] = ["Gym Mat Black", 65, "Sync Up Fitness", "The Yoga Mat was created for ultimate comfort. 20 mm thick cushioning and 190 cm long, this is the last workout mat you will ever need. The mat's surfaces, both top & bottom, come with anti-slip and anti-slide design, so you don't have to keep adjusting it after every rep!", "", "Gym Mat Black"]; products[242] = ["Gym Mat Khaki", 65, "Sync Up Fitness", "The Yoga Mat was created for ultimate comfort. 20 mm thick cushioning and 190 cm long, this is the last workout mat you will ever need. The mat's surfaces, both top & bottom, come with anti-slip and anti-slide design, so you don't have to keep adjusting it after every rep!", "", "Gym Mat Khaki"]; products[243] = ["Gym Mat Pink", 65, "Sync Up Fitness", "The Yoga Mat was created for ultimate comfort. 20 mm thick cushioning and 190 cm long, this is the last workout mat you will ever need. The mat's surfaces, both top & bottom, come with anti-slip and anti-slide design, so you don't have to keep adjusting it after every rep!", "", "Gym Mat Pink"]; products[244] = ["Gym Mat Blue", 65, "Sync Up 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.", "", "Gentle Yoga Mat 10 mm"]; products[212] = ["Long Sleeves Hiking T-Shirt ", 95, "Sync Up Fitness", "Our engineers designed this warm T-shirt with long sleeves for occasional hikes in cold weather. Comfortable and warm for hiking use. This warm and breathable T-shirt will be comfortable during your cold weather hikes. Zipped collar and mesh fabric inserts to increase ventilation and guarantee a good experience.", "", "Slim Fit Track Pants"]; products[214] = ["Long Sleeves Running T-Shirt ", 95, "Sync Up Fitness", "Our design teams developed this warm and breathable men's long-sleeved winter T-shirt for running in cold weather. Looking for more comfort in autumn and winter? With breathable fabric and no side seams, this long-sleeved winter running T-shirt provides optimal comfort for temperatures between 10 and 20°C.", "", "Cotton Gym Tracks"]; products[215] = ["Compression T-Shirt ", 85, "Sync Up Fitness", "Designed for workouts, walking, running & even sports - this versatile T-Shirt - offer optimal compression to boost performance - while the dri fit moisture wicking fabric keeps you comfortable. The super stretch & breathable fabric makes it a must have for fitness enthusiasts who workout for long hours. ", "", "Jogging Bottoms"]; products[216] = ["Long Sleeves Trail T-Shirt ", 95, "Sync Up Fitness", "Slightly fitted long-sleeved trail running jersey for running in cool conditions over every distance (training or competition). With its bespoke trail running fit, this jersey can withstand backpack friction. Thanks to its mesh areas, perspiration is eliminated and you can control ventilation with the half zip.", "", "2-in-1 Gym Shorts"]; products[217] = ["Breathable Tank Top ", 55, "Sync Up Fitness", "A must have for every fitness wardrobe, these ultra comfortable tank tops are perfect for working out, running, sports training & even lounging around! The ultra-lightweight fabric is breathable and moisture wicking in nature, keeping you comfortable & dry. A favorite amongst bulked up gym rats too, who love to get motivated by the pump! ", "", "Cotton Gym Shorts"]; products[217] = ["Soft Yoga Shorts", 65, "Sync Up Fitness", "Our men's yoga design team created these shorts to connect you to yoga's Indian roots. Stretchy, soft shorts made mainly from responsibly-sourced cotton (from organic farming or recycled). Large elastic waistband for unrestricted pranayamas.", "", "Running Shorts"]; products[219] = ["Hiking Cargo Shorts ", 65, "Sync Up Fitness", "Our backpacker designers have designed these shorts so you can travel the world with peace of mind, in all environments. Equipped with numerous pockets, including three secure ones, these durable cargo shorts are the perfect companion to see the action and discover the world's regions.", "", "Training Shorts"]; products[220] = ["Fitted Running Tracks ", 90, "Sync Up Fitness", "Crafted for serious athletes, these fitted tracks give you the compression you need to boost blood circulation to your legs for long-duration workouts, runs or rides. Made with superstretch moisture wicking fabric, they give you complete freedom of movement, while keeping you dry. The foot zip lets you take on and off - without removing your shoes too! ", "", "Golf Shorts"]; products[220] = ["Comfort Running Tracks", 90, "Sync Up Fitness", "Originally created for sports (racket) training in winters, these comfort tracks have become our best sellers - enjoyed by sports, fitness, running, gym enthusiasts alike! The thick material offers thermal insulation, while the moisture wicking fabric keeps you comfortable. A must have in your workout wardrobe. ", "", "Running Jacket"]; products[235] = ["Warm Workout Tracks ", 90, "Sync Up Fitness", "These warm tracks are perfect for medium winters, keeping you warm, comfortable & active! These tracks are great for running, sports & even workouts. They come with 2 pockets to carry your phones, keys or in case you are a tennis player - even the 2 balls. ", "", "Hiking Jacket"]; products[236] = ["Compression T-Shirt", 85, "Sync Up Fitness", "Our team of enthusiasts designed this lightweight, breathable t-shirt for regular mountain walking. It is very comfortable thanks to its moisture absorption and perspiration wicking properties.", "", "Workout T-Shirt"]; products[237] = ["Compression T-Shirt", 85, "Sync Up Fitness", "Designed for workouts, walking, running & even sports - this versatile T-Shirt - offer optimal compression to boost performance - while the dri fit moisture wicking fabric keeps you comfortable. The super stretch & breathable fabric makes it a must have for fitness enthusiasts who workout for long hours. ", "", "Cycling Jersey"]; products[238] = ["Compression T-Shirt", 85, "Sync Up Fitness", "Designed for workouts, walking, running & even sports - this versatile T-Shirt - offer optimal compression to boost performance - while the dri fit moisture wicking fabric keeps you comfortable. The super stretch & breathable fabric makes it a must have for fitness enthusiasts who workout for long hours. ", "", "Long Sleeve Running Tee"]; 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).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); 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 +"
" + "
$" + (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); } else { $("#cartBox").html(" Loading..."); } return false; } }; var round = function(value, decimals) { return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals); };