var products = []; products[100] = ["Collagen-B Beauty Infusion Powder (15 Packets)", 29.98, "Radiance Daily", "JBA Collagen-B is a daily beauty drink mix that may help smooth the appearance of fine lines, support skin hydration, and promote the health of hair, nails, and joints. Formulated with 5,000 mg of marine collagen peptides along with a blend of vitamins, minerals, and botanicals, it offers a comprehensive approach that may support overall beauty and wellness from within.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Radiance Daily. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 1-866-201-8273 or email support@radiancedaily.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "", "001"]; products[101] = ["GlucoTrojan Beauty, Gut & Heart Health in One", 29.98, "Radiance Daily", "This delicious marine collagen drink may help support the health of skin, hair, and nails, while also promoting balanced blood sugar and cholesterol levels. Additionally, it may contribute to digestive wellness and joint comfort, all conveniently delivered in a single daily packet.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Radiance Daily. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 1-866-201-8273 or email support@radiancedaily.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "", "002"]; products[102] = ["Glow From Within Collagen Electrolyte Mocktail", 27.9, "Radiance Daily", "Recharge, restore, and radiate with this collagen electrolyte mocktail—an all-in-one beauty and wellness drink that may help support skin health, hydration, and recovery in a flavorful, refreshing mix. Whether after a workout or as a mid-day boost, this guilt-free blend may help you feel refreshed and support overall well-being from the inside out.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Radiance Daily. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 1-866-201-8273 or email support@radiancedaily.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "", "003"]; products[103] = ["Hello Beautiful Caffe Latte Collagen Coffee", 24.98, "Radiance Daily", "Wake up and glow with this collagen-infused instant coffee blend—a rich, velvety drink that may help support skin, hair, nails, and metabolism. Enjoy the comforting taste of a café-style latte without the crash or added sugar, while giving your body a boost of beauty and energy in every creamy sip.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Radiance Daily. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 1-866-201-8273 or email support@radiancedaily.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "", "004"]; products[104] = ["Hello Zero Sugar Beautiful Latte", 24.98, "Radiance Daily", "Say hello to guilt-free indulgence with this smooth, creamy instant latte infused with 5g of collagen and essential vitamins, with zero sugar. It may help support skin health, energy levels, and overall wellness, all while allowing you to enjoy the rich flavor of a coffeehouse latte—without the calories or crash.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Radiance Daily. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 1-866-201-8273 or email support@radiancedaily.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "", "005"]; products[105] = ["Love is in the Hair Daily Hair Nourishment Latte", 24.98, "Radiance Daily", "Formulated with a powerful combination of collagen, keratin, and biotin, this blend may help support healthy hair growth, enhance strength, and promote overall hair beauty. These key nutrients work together to nourish hair from within, helping to improve texture, reduce breakage, and maintain a vibrant, healthy appearance over time.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Radiance Daily. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 1-866-201-8273 or email support@radiancedaily.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "", "006"]; products[106] = ["Harmony Hot Cacao Beauty & Hormone Balance", 24.98, "Radiance Daily", "Wrap yourself in comfort with this rich, velvety hot cacao blend, made with calming adaptogens and nourishing collagen. It may help support relaxation, hormone balance, and stress relief, offering a soothing evening ritual that combines wellness and indulgence in every sip.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Radiance Daily. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 1-866-201-8273 or email support@radiancedaily.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "", "007"]; products[107] = ["Harmony Zero Sugar Hot Cacao ", 8.99, "Radiance Daily", "Meet your new nightly ritual: a rich, indulgent hot cacao latte formulated with adaptogens, collagen, and zero sugar. This wellness blend may help support hormonal balance, stress relief, and radiant beauty. Enjoy a soothing way to unwind, rebalance, and glow from within—without the guilt.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Radiance Daily. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 1-866-201-8273 or email support@radiancedaily.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "", "008"]; products[108] = ["ATIV Beauty Daily Collagen + Antioxidants", 9.98, "Radiance Daily", "ATIV Beauty is a daily beauty-from-within drink featuring a blend of marine collagen, antioxidants, and skin-nourishing vitamins. It may help support hydrated skin, stronger hair, and a youthful, radiant appearance—all in a zero-sugar formula designed to help you glow naturally.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Radiance Daily. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 1-866-201-8273 or email support@radiancedaily.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "", "009"]; products[109] = ["Verestor Capsules", 29.98, "Radiance Daily", "Verestor® is a premium heart-health formula crafted to support cardiovascular wellness, promote healthy blood vessels, and help maintain flexible circulation—powered by nattokinase, phytosterols, and potent antioxidants.", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Radiance Daily. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 1-866-201-8273 or email support@radiancedaily.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "", "010"]; products[110] = ["Collagen-B Beauty Infusion Powder (15 Packets)", 25.48, "Radiance Daily", "", "", "By placing your monthly recurring order of __prdname__ __qnty__ 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 a receipt after each successful transaction. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "Monthly Subscription", "001"]; products[111] = ["Collagen-BETHIN Beauty, Gut & Heart Health in One", 29.75, "Radiance Daily", "", "", "By placing your monthly recurring order of __prdname__ __qnty__ 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 a receipt after each successful transaction. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "Monthly Subscription", "002"]; products[112] = ["Glow From Within Collagen Electrolyte Mocktail", 23.71, "Radiance Daily", "", "", "By placing your monthly recurring order of __prdname__ __qnty__ 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 a receipt after each successful transaction. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "Monthly Subscription", "003"]; products[113] = ["Hello Beautiful Caffe Latte Collagen Coffee", 21.23, "Radiance Daily", "", "", "By placing your monthly recurring order of __prdname__ __qnty__ 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 a receipt after each successful transaction. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "Monthly Subscription", "004"]; products[114] = ["Hello Beautiful Latte Zero Sugar", 21.23, "Radiance Daily", "", "", "By placing your monthly recurring order of __prdname__ __qnty__ 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 a receipt after each successful transaction. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "Monthly Subscription", "005"]; products[115] = ["Love is in the Hair Daily Hair Nourishment Latte", 21.23, "Radiance Daily", "", "", "By placing your monthly recurring order of __prdname__ __qnty__ 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 a receipt after each successful transaction. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "Monthly Subscription", "006"]; products[116] = ["Harmony Hot Cacao Beauty & Hormone Balance", 21.23, "Radiance Daily", "Prioritize your well-being with our Blood Health Gummies. This expertly crafted formula may help support healthy circulation, naturally boost your energy, and contribute to balanced blood sugar and metabolic wellness.", "", "By placing your monthly recurring order of __prdname__ __qnty__ 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 a receipt after each successful transaction. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "Monthly Subscription", "007"]; products[117] = ["Harmony Hot Cacao Zero Sugar", 7.94, "Radiance Daily", "", "", "By placing your monthly recurring order of __prdname__ __qnty__ 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 a receipt after each successful transaction. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "Monthly Subscription", "008"]; products[118] = ["ATIV Beauty Daily Collagen + Antioxidants", 8.48, "Radiance Daily", "", "", "By placing your monthly recurring order of __prdname__ __qnty__ 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 a receipt after each successful transaction. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Radiance Daily.", "Monthly Subscription", "009"]; 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, comnId) { 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 + "-" + comnId; 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 comn_Id = parseInt(items[i].substring(position + 3)); //alert(comn_Id); var quantity = parseInt(items[i].substring(position + 1)); if (order != "") { order += "|"; } if (prodId == itemId) { //alert(comn_Id); 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 += itemId + "-" + quantity + "-" + comnId; itemExists = true; } else { if(comn_Id == comnId){ alert("Product already exist in cart"); return false; itemExists = true; }else{ order += prodId + "-" + quantity + "-" + comnId; } } orderedItems[prodId] = quantity; } if (!itemExists) { if (order != "") { order += "|"; } order += itemId + "-" + Qty + "-" + comnId; 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, comnId) { 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, comnId) { 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(); }); } showCart(false, 'empty'); }; 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 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[prodId][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-"]').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 += "
Order Summary 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][5]; termTxt = replaceAllStr(termTxt, ' __prc__', quantity * products[prodId][1].toFixed(2)); termTxt = replaceAllStr(termTxt, '__prdname__', products[prodId][0]); termTxt = replaceAllStr(termTxt, '__prdqnty__', products[prodId][5]); termTxt = replaceAllStr(termTxt, '__qnty__', products[prodId][6]); term_htm += '' + termTxt + ''; cartHtml += "
" + "
" + "

" + products[prodId][4] + " "+ quantity +"

" + "
" + "

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

" + "

$" + sub_total.toFixed(2) + "

" + "
" + "
" + "" + ""+ "
"+ quantity +"
" + "
$" + (products[prodId][1]).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); };