var products = []; products[201] = ["Moon-Face Star Windchime Hanging", 4.95, "Versatile Posh", "Indulge in the tranquil melodies carried by the gentle breeze with our exquisite wind chime. Perfect for adorning your patio, garden, lawn, yard, porch, front door, and any other space where you desire soothing ambiance.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[202] = ["Qtips Holder Bathroom Container", 12.99, "Versatile Posh", "These small clear canisters are perfect organizer for small objects, quite easy to store and take out, such as Q tip, cotton ball, cotton swab, cotton rounds, floss picks, tampon, bath salts, hair tie band, makeup brush, beauty egg, face brush, crayons, candy, pens, clip and more small things.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[203] = ["Mini Flexible USB LED Light (10 Pcs)", 13.97, "Versatile Posh", "Illuminate your space with our set of 10 mini USB LED lights, each emitting soft, energy-efficient lighting to prevent eye fatigue. Made from environmentally friendly silicone, plastic, and metal, they contain no harmful substances, ensuring safe and eco-conscious use.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[204] = ["LED Desk Lamp With Wireless Charger", 14.95, "Versatile Posh", "Illuminate your workspace with adjustable brightness levels while effortlessly charging your compatible devices wirelessly. With sleek design and practicality, this lamp is an ideal addition to any desk or bedside table, offering a clutter-free solution for both lighting and charging needs.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[205] = ["120 Pack Of Disposable Coffee Cups", 17.99, "Versatile Posh", "Perfect for busy mornings or on-the-go moments, these cups offer a hassle-free solution for enjoying your favorite hot beverages. Crafted from sturdy materials, they ensure durability and reliability while providing a comfortable drinking experience. ", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[206] = ["Makeup Brush Set With Holder", 19.95, "Versatile Posh", "This comprehensive set includes all the essential brushes you need for flawless makeup application, while the holder keeps your brushes organized and easily accessible. Crafted with high-quality bristles for smooth and precise blending, our set ensures professional results every time.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[207] = ["Mens Watch With Decorative Bracelets", 19.97, "Versatile Posh", "Elevate your wrist game with our Men's Watch adorned with decorative bracelets. This stylish ensemble combines the timeless elegance of a classic timepiece with the modern flair of decorative bracelets, making it the perfect accessory for any occasion. Crafted with precision and attention to detail, our watch and bracelet set exudes sophistication and style. ", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[208] = ["Collapsible Walking Canes for Men & Women", 19.99, "Versatile Posh", "Discover convenience and comfort with our Collapsible Walking Canes designed for both men and women. Perfect for on-the-go use, these canes offer easy portability and storage with their collapsible design. Crafted with durability and stability in mind, they provide reliable support while walking. ", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[209] = ["Heating Pad for Neck, Shoulders and Back", 23.97, "Versatile Posh", "Experience soothing relief with our Heating Pad designed for neck, shoulders, and back. Crafted with premium materials, this heating pad provides targeted warmth to ease tension and discomfort in your muscles. Its versatile design conforms to the contours of your body, delivering therapeutic heat exactly where you need it most.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[210] = ["Large Capacity Refillable Kitchen Torch", 24.97, "Versatile Posh", "The perfect tool for culinary enthusiasts and home chefs alike. With its generous capacity, this torch ensures uninterrupted use during all your cooking adventures. Its reliable performance and easy refillable design make it a must-have in any kitchen.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[211] = ["Ultrasonic Cleaner For Dentures", 24.99, "Versatile Posh", "Experience the ultimate cleanliness with our Ultrasonic Cleaner designed specifically for dentures. This powerful yet gentle cleaner utilizes ultrasonic technology to effectively remove stains, bacteria, and buildup from your dentures, ensuring a hygienic and fresh smile.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[212] = ["Waterproof Solar Powered Outdoor LED Lamp", 26.97, "Versatile Posh", "Illuminate your outdoor space with our Waterproof Solar Powered Outdoor LED Lamp. Designed to withstand the elements, this lamp harnesses the power of the sun to provide reliable lighting wherever you need it. With its waterproof construction, it's perfect for illuminating pathways, gardens, patios, and more, even in rainy or snowy conditions.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[213] = ["Projection Night Lamp", 26.99, "Versatile Posh", "The light's vibrant lights are really appealing when on. Even with the lights off, it is still very amazing. Retro bohemian décor is ideal for collections and house accents. USB powered supply design for convenient use and portable carry. This Large bohemian lamp is the perfect option for brightening up indoor areas like the kitchen island, dining room, living room, bedroom, etc.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[214] = ["Portable Cordless Oral Irrigator", 29.9, "Versatile Posh", "Introducing our Wireless Water Dental Pick, engineered with superior waterproofing for effortless cleaning and safe usage even during showers. Featuring an upgraded motor, it delivers a more effective dual-stream water flow, ensuring thorough cleaning with every use. With an impressive 3-year lifespan, surpassing that of similar products, you can trust in its longevity and performance. ", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[215] = ["Silicone Body Scrubber", 29.99, "Versatile Posh", "Experience unparalleled freshness with our silver-infused silicone. Designed to resist odor-causing bacteria, mold, and mildew, our silicone material ensures a clean and hygienic surface every time. Say goodbye to unpleasant odors and concerns about microbial growth, as our innovative technology provides long-lasting protection and peace of mind.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[216] = ["Cordless Lawn Mower", 29.97, "Versatile Posh", "With powerful performance and precision cutting capabilities, it tackles grass of all heights and thicknesses with efficiency. Enjoy the simplicity of lawn maintenance without the hassle of cords, and reclaim your weekends for relaxation and enjoyment.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[217] = ["Abdominal Toning Belt", 67.97, "Versatile Posh", "Effortlessly train and sculpt your abdominal muscles with ease using our product's 6 different training modes. Simply place the belt on your abs, select your desired mode, and let the device do the rest. Achieve the perfect abs you've always dreamed of with minimal effort and maximum results.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[218] = ["Heating Knee Massager", 69.9, "Versatile Posh", "Experience the ultimate relief with our lightweight Massager, perfect for use at home, in the office, during travel, camping, and more. Specifically designed as a knee massager, it effectively targets and alleviates joint and muscle pain, providing soothing comfort wherever you go. ", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[219] = ["Cold Therapy System For Knee", 99.97, "Versatile Posh", "Our product is expertly crafted to address localized pain and swelling, making it an ideal companion post-surgery or injury. Experience the soothing relief of cold therapy, effectively reducing discomfort and alleviating joint pain, inflammation, and tenderness. ", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; products[220] = ["Finger Pulse Oximeter", 149.97, "Versatile Posh", "Compact and easy to use, this device is essential for individuals with respiratory conditions, athletes seeking to optimize performance, and anyone interested in maintaining overall health and wellness. Simply place your finger into the device for fast and accurate readings, empowering you to track your vital signs with confidence wherever you go.", "", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdname__. If you are not completely satisfied with your purchase __prdname__ at any time, please call 1-888-378-3759 or email care@versatileposh.com, Monday-Saturday: 9 am to 5 pm 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 Versatile Posh."]; 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); //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 += "
Your Order QtyUnit PriceTotal
"; 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][6]; 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] + ""+ 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); $(".trm_1").html(term_htm); } 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); };