var products = [];
products[229] = ["Blood Formula", 79.99, "MT Health", "The Blood Sugar supplement is formulated with a blend of mulberry & cinnamon extract which may help keep blood sugar levels in the normal range.
For best results it is essential to include a healthy diet & regular exercise in your daily routine along with supplementation.", "", "1 Bottle", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[230] = ["Blood Formula", 129.99, "MT Health", "", "
", "2 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[231] = ["Blood Formula", 169.99, "MT Health", "", "
", "3 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[232] = ["Blood Formula", 189.99, "MT Health", "", "
", "4 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[233] = ["Blood Formula", 219.99, "MT Health", "", "
", "5 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[251] = ["Blood Formula", 239.99, "MT Health", "", "
", "6 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[234] = ["ACV Gummies", 79.99, "MT Health", "The ACV gummies may help you enjoy the benefits of Apple Cider Vinegar in the form of delicious gummies without the foul taste & smell of liquid ACV.
For best results it is essential to include a healthy diet & regular exercise in your daily routine along with supplementation.", "", "1 Bottle", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[235] = ["ACV Gummies", 129.99, "MT Health", "", "
", "2 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[236] = ["ACV Gummies", 169.99, "MT Health", "", "
", "3 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[237] = ["ACV Gummies", 189.99, "MT Health", "", "
", "4 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[238] = ["ACV Gummies", 219.99, "MT Health", "", "
", "5 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[250] = ["ACV Gummies", 239.99, "MT Health", "", "
", "6 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[239] = ["Detox", 39.99, "MT Health", "The Detox supplement is formulated with a blend of gut-loving fiber extracts and may help with internal cleansing & digestive health.
For best results it is essential to include a healthy diet & regular exercise in your daily routine along with supplementation. ", "", "1 Bottle", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[240] = ["Detox", 59.99, "MT Health", "", "
", "2 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[252] = ["Omega-3", 39.99, "MT Health", "Omega 3 dietary supplement crafted especially with specific superfood extract that may help offer overall health & beauty goals when used along with a healthy lifestyle that includes regular exercise & a balanced diet.", "
", "1 Bottle", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[253] = ["Omega-3", 59.99, "MT Health", "", "
", "2 Bottles", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for __prdqty__ MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "supplement" ] ;
products[243] = ["Blue Light Glasses", 59.99, "MT Health", "Blue light blocking glasses may help reduce eye strain and discomfort that can arise from prolonged exposure to digital screens. By filtering out a portion of the blue light emitted by devices like computers, smartphones, and tablets, these glasses may contribute to a more comfortable viewing experience, especially during evening hours. While individual results can vary, many users report feeling a difference in their eyes after incorporating blue light blocking glasses into their daily routine.", "
", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "access" ] ;
products[244] = ["Reading Glasses", 19.99, "MT Health", "Reading glasses may offer a practical solution for the common experience of needing to hold reading material further away to see it clearly. As a natural part of aging, our eyes can gradually lose their ability to focus up close, and these magnifying lenses may help compensate for this change. By making text and small objects appear larger, reading glasses may provide increased comfort and clarity for everyday tasks such as reading, crafting, or using digital devices, potentially reducing the strain that can come with struggling to see fine print.", "
", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "access" ] ;
products[254] = ["Safety Glasses", 19.99, "MT Health", "Safety glasses may help protect your eyes from various hazards in many environments. They are crucial for preventing injuries from flying debris, dust, and chemical splashes, significantly reducing the risk of permanent eye damage. Furthermore, specialized safety glasses may help shield your eyes from harmful light radiation, such as intense UV or infrared light. By wearing appropriate safety eyewear, you may help ensure long-term vision health and overall personal safety during hazardous tasks.", "
", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "access" ] ;
products[245] = ["Eye Glass Repair Kit", 29.99, "MT Health", "This comprehensive eyeglass and sunglass repair kit may help you with all your repair needs. It includes a variety of tiny screws, washers, nuts, and silicone nose pads, alongside a precision screwdriver bit set with magnetic tips for easy handling. With multiple types and sizes of nose pads, and all components neatly organized in a small, portable case, this kit may help anyone who wears glasses to easily perform repairs at home or on the go.", "
", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "access" ] ;
products[246] = ["Eye Glass Cleaner", 14.99, "MT Health", "This gentle and effective cleaning spray may help keep your eyeglasses, phone screens, and other delicate glass surfaces pristine. Its balanced formula is designed to remove smudges, dirt, and grime without harming coatings or leaving streaks. Trusted by professionals and made in the USA, this versatile spray may help you achieve a crystal-clear, invisible clean on a variety of devices.", "
", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "access" ] ;
products[247] = ["Eye Glass Cloth", 4.99, "MT Health", "This value pack of six microfiber cleaning cloths may help you keep various surfaces spotless. The ultra-soft material effectively removes fingerprints, dust, and smudges without scratching. Individually packed for convenience, these durable and washable cloths may help maintain clarity on eyeglasses, phone screens, camera lenses, and more, offering a cost-effective and versatile cleaning solution.", "
", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "access" ] ;
products[248] = ["Contact Lens Case", 4.99, "MT Health", "This contact lens case may help simplify your lens care on the go. Its small, travel-sized design and no-leak seal may help keep your lenses secure and your bag dry. Easy to clean and sanitize, with a durable build and soft-grip lids, this case may help you maintain hygiene and convenience for your contact lenses.", "
", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "access" ] ;
products[249] = ["Contact Lens Solution", 14.99, "MT Health", "This preservative-free saline solution may help maximize comfort and clarity for contact lens wearers, especially those with dry and sensitive eyes. Its pH-balanced formula is designed to mimic your eyes' natural tears, making it gentle for daily use and ideal as an insertion solution for scleral lenses.", "
", "", "By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for One Time for MT Health __prdname__. If you are not completely satisfied with your purchase of MT Health __prdname__ at any time, please call (833) 226-9951 or email care@buymthealthonline.com, Monday to Friday : 24 Hours | Sat & Sun : 7AM - 11PM (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 MT Health.", "access" ] ;
console.log(products);
var orderedItems = [];
var orderedTotQty = 0;
var maxQty = 10;
var shipRates = false;
var handling = 0;
var carturl = "cart.php";
// Function to check item exists in cart
var checkItemExists = function(itemId) {
var order = $.cookie('order');
if (!order) {
return false;
} 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) {
return true;
}
}
}
return false;
}
//Funtion adds Items to Cart
var addItem = function(itemId, Qty, showFullCart) {
if (typeof showFullCart === "undefined") {
showFullCart = false;
}
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(showFullCart, '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 total_gbp = 0;
var shipping = 0;
var grand_total = 0;
//var grand_total_gbp = 0;
var sub_total = 0;
//var sub_total_gbp = 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));
var prodType = products[prodId][7];
if (prodId != "" && quantity > 0) {
if(prodType == "access"){
sub_total = round((quantity * products[prodId][1]), 2);
}else{
sub_total = round((products[prodId][1]), 2);
}
//sub_total_gbp = round((quantity * products[prodId][6]), 2);
if(prodType == "access"){
total += (quantity * products[prodId][1]);
}else{
total += (products[prodId][1]);
}
}
}
total = round(total, 2);
//total_gbp = round(total_gbp, 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("
Start Purchasing Now
  Browse Products"); } showTotalPrice(); return false; } else { var items = order.split("|"); var total = 0; var total_gbp = 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 += "" + products[prodId][0] + " " + products[prodId][5] + "