var products = [];
products[126] = ["Keto + ACV Gummies", 24.99, "Nourish Pro Shop", "Our Keto + ACV gummies are designed to fit seamlessly into your fast-paced life, offering a tasty alternative to traditional supplements. By making these part of your morning ritual, you may help support your bodyâs natural fat-burning processes, promote a more balanced gut environment, and sustain the steady energy you need to tackle your to-do list with confidence.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy Sample Pack"];
products[100] = ["Keto + ACV Gummies", 129.99, "Nourish Pro Shop", "", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 1 Get 1 Free"];
products[101] = ["Keto + ACV Gummies", 189.99, "Nourish Pro Shop", "", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 2 Get 2 Free"];
products[102] = ["Keto + ACV Gummies", 239.99, "Nourish Pro Shop", "", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 3 Get 3 Free"];
products[103] = ["Keto + ACV Gummies", 129.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 1 Get 1 Free (Monthly Subscription)"];
products[104] = ["Keto + ACV Gummies", 189.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 2 Get 2 Free (Monthly Subscription)"];
products[105] = ["Keto + ACV Gummies", 239.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 3 Get 3 Free (Monthly Subscription)"];
products[106] = ["Blood Health Gummies", 34.99, "Nourish Pro Shop", "Our Blood Health Gummies offer a sophisticated blend of nutrients tailored to support the complex systems that keep you moving. By integrating this targeted formula into your daily regimen, may help optimize nutrient delivery throughout the body, may help maintain the steady stamina required for peak daily performance, and may help support your body's natural ability to regulate glucose levels.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 1 Get 1 Free"];
products[107] = ["Blood Health Gummies", 44.99, "Nourish Pro Shop", "", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 2 Get 1 Free"];
products[108] = ["Blood Health Gummies", 199.99, "Nourish Pro Shop", "", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 7 Get 7 Free"];
products[109] = ["Blood Health Gummies", 34.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 1 Get 1 Free (Monthly Subscription)"];
products[110] = ["Blood Health Gummies", 44.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 2 Get 1 Free (Monthly Subscription)"];
products[111] = ["Blood Health Gummies", 199.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 7 Get 7 Free (Monthly Subscription)"];
products[114] = ["Male Enhancement Gummies", 5, "Nourish Pro Shop", "Unleash your potential with our Male Enhancement Gummies. Packed with key nutrients, these gummies may help naturally boost your energy, enhance overall performance, support muscle recovery, and increase endurance for achieving your peak fitness goals.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy Sample Pack"];
products[112] = ["Male Enhancement Gummies", 19.99, "Nourish Pro Shop", "", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 1 Bottle"];
products[113] = ["Male Enhancement Gummies", 24.99, "Nourish Pro Shop", "", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 2 Get 1 Free"];
products[115] = ["Male Enhancement Gummies", 19.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 1 Bottle (Monthly Subscription)"];
products[116] = ["Male Enhancement Gummies", 24.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 2 Get 1 Free (Monthly Subscription)"];
products[118] = ["Cognitive Formula", 29.99, "Nourish Pro Shop", "The Cognitive Formula acts as a sophisticated ally for your most valuable asset: your mind. By making this advanced botanical blend a part of your morning ritual, may help bridge the gap between fatigue and flow, may help reinforce the neural pathways responsible for rapid information processing, and may help sustain a calm, clear-headed perspective during high-pressure moments.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 1 Get 1 Free"];
products[119] = ["Cognitive Formula", 64.99, "Nourish Pro Shop", "", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 2 Get 3 Free"];
products[120] = ["Cognitive Formula", 89.99, "Nourish Pro Shop", "", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "Buy 3 Get 4 Free"];
products[121] = ["Cognitive Formula", 29.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 1 Get 1 Free (Monthly Subscription)"];
products[122] = ["Cognitive Formula", 64.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 2 Get 3 Free (Monthly Subscription)"];
products[123] = ["Cognitive Formula", 89.99, "Nourish Pro Shop", "", "
", "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 Nourish Pro Shop.", "Buy 3 Get 4 Free (Monthly Subscription)"];
products[124] = ["Cleanse", 59.99, "Nourish Pro Shop", "Rediscover your internal balance. Our Cleanse Supplement offers a sophisticated, non-aggressive approach to full-body harmony. By incorporating this botanical blend into your routine, you may help facilitate the bodyâs natural filtering systems, may help alleviate occasional bloating for a lighter daily feel, and may help restore the digestive rhythm necessary for a refreshed, high-energy lifestyle.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "2 Bottles"];
products[127] = ["Cleanse", 59.99, "Nourish Pro Shop", "", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", "2 Bottles (Monthly Subscription)"];
products[128] = ["Non-Slip Yoga Mat", 64.99, "Nourish Pro Shop", "Whether itâs a quick morning stretch or a high-intensity circuit, this high-density NBR mat is built to handle the grind. It provides that essential layer of extra padding for your knees and elbows, while the anti-skid texture keeps you planted firmly in place. Lightweight and ready to roll, it comes with a custom strap so you can grab it and go without a second thought.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", ""];
products[129] = ["Bluetooth Body Fat Scale", 89.99, "Nourish Pro Shop", "Stop guessing and start growing. This smart scale provides the deep-dive insights you need to master your fitness journey, connecting directly to your favorite apps so your progress is always at your fingertips. From solo grinds to family challenges, the wireless sync and clear display ensure that every bit of hard work is documented and easy to track.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", ""];
products[130] = ["Ultimate Workout Plan Bundle", 3.5, "Nourish Pro Shop", "Achieve your fitness aspirations with the Ultimate Workout Plan Bundle, a comprehensive digital collection designed to adapt to your unique journey. Whether you're looking to build strength, shed excess weight, or simply elevate your daily activity, this versatile ebook library may help you find the right routine to match your specific goals.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time Purchase of Nourish Pro Shop __prdname__ __qnty__. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", ""];
products[131] = ["Fascia Foot Massager", 24.99, "Nourish Pro Shop", "Find natural recovery with a traditional wooden roller designed to alleviate tension and promote blood flow. This specialized tool focuses on trigger point therapy, offering a non-invasive way to manage plantar fasciitis and leg fatigue. Whether youâre recovering from a long run or a long day on your feet, it delivers professional-level relief from the comfort of your chair.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", ""];
products[132] = ["Resistance Band with Door Anchor", 34.99, "Nourish Pro Shop", "These resistance bands may help enhance your workouts with four levels of resistance, making them suitable for beginners and advanced users alike. Made from durable latex with a non-slip grip, they may help provide a secure and long-lasting training experience. Lightweight and portable, they may help you stay fit anywhere at home, outdoors, or on the go.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", ""];
products[133] = ["Elastic Yoga Pedal Pull Rope for Stretching", 39.99, "Nourish Pro Shop", "Enhance your flexibility and strength with our Elastic Yoga Pedal Pull Rope, designed for a full-body stretching experience. This versatile resistance band may help you target arms, legs, shoulders, and core with every use. Built with durable elastic rope and anti-slip handles, it may help ensure a secure and comfortable grip during your routine. Lightweight and portable, it may help you maintain an active lifestyle whether you're at home, the gym, or on the go.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", ""];
products[134] = ["Fitness Smartwatch for Men and Women", 199.99, "Nourish Pro Shop", "Stay on top of your wellness and daily life with our Fitness Smartwatch, designed to keep you informed and motivated. It may help you track key fitness metrics, monitor your heart rate throughout the day, and gain insights into your sleep patterns for better recovery. With multiple sport modes and smart notifications, it may help you stay connected to what matters while supporting a more organized, health-conscious lifestyle.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __prdname__ __qnty__ One Time Purchase of Nourish Pro Shop. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", ""];
products[135] = ["Healthy Meal Plans Bundle", 5, "Nourish Pro Shop", "Fuel your body with the Healthy Meal Plans Bundle, your all-in-one resource for nutritious eating tailored to your unique goals. This comprehensive collection may help support your weight loss journey with calorie-conscious recipes, may help fuel muscle gain with protein-rich meal ideas, and may help promote overall wellness through balanced, whole-food options designed for real-life practicality.", "
", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time Purchase of Nourish Pro Shop __prdname__ __qnty__. If you are not completely satisfied with your purchase of __prdname__ at any time, please call 8664739919 or email support@nourishproshop.com. You will receive your package within 3-5 business days of payment via USPS First Class Mail. Your card will be billed as Nourish Pro Shop.", ""];
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();
});
}
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 += "" + products[prodId][4] + " "+ quantity +"
" + "" + products[prodId][0] + " " + products[prodId][6] + "
" + " $" + sub_total.toFixed(2) + " 