var products = [];
products[211] = ["Holder Strap For Sunglasses", 7, "True Sight Vision", "This durable eyewear retainer, crafted from high-grade silicone and rugged nylon rope, may help keep your glasses right where you need them, whether you are on a high energy outdoor adventure or going through a typical day. Its lightweight construction may help provide allâday comfort, while the adjustable strap offers a flexible fit compatible with frames wider than 4.5mm. Backed by a lifetime warranty, it is designed to deliver lasting reliability wherever you go.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", "2 Pcs"];
products[212] = ["Eye Glass Repair Kit", 8.49, "True Sight Vision", "Experience the satisfaction of a perfect fit. This curated toolkit provides the specialized components needed to address common eyewear wear and tear. By providing a comprehensive selection of micro-hardware and magnetic precision tools, this set may help you maintain the structural integrity of your frames at home. From tightening a loose temple to replacing a lost screw, these professional-grade instruments may help ensure your eyewear remains as reliable as the day you bought it.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", ""];
products[213] = ["Glasses Cleaning Kit", 9.99, "True Sight Vision", "This allâinâone care kit may help keep your eyewear crystal clear and comfortable with premium microfiber materials that lift dust, smudges, and oils without streaks. The included antiâfog spray may help prevent condensation, while nonâslip accessories and precision adjustment tools may help you maintain a secure, custom fit wherever you go..
Lens Cleaner Ingredients:Purified Water (Aqua) â gentle, lens-safe base, Isopropyl Alcohol (5â20%) â dissolves oils, fingerprints, and smudges, Non-Ionic Surfactants â lift dirt and debris without streaking Anti-Fog Agents (e.g., Polyethylene Glycol or similar polymers) â maintain long-lasting clarity, pH Stabilizers â keep the solution safe for all lens types, Preservatives (e.g., Phenoxyethanol) â prevent microbial growth, Fragrance-Free Additives â optional, leave no scent or residue.
Formulated Without: Ammonia, Acetone, and Harsh solvents", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", ""];
products[214] = ["Eyeglasses Holder Stand", 11.49, "True Sight Vision", "This stylish eyeglass holder may help keep your glasses safe and accessible with a durable exterior and soft, plush interior that cushions lenses against scratches and dust. Its stable, tipâproof base may help prevent bent stems, while the compact design offers a convenient home for your frames on a nightstand, desk, or coffee table.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", "2 Pcs"];
products[215] = ["Adjustable Shower Goggles", 19.95, "True Sight Vision", "Protect your aesthetic investments with a design centered on sophisticated aftercare. This dual-set of lash goggles may help maintain the bond of your extensions by acting as a reliable barrier against direct water contact. Featuring high-clarity polycarbonate lenses and a streamlined profile, these shields may help preserve your lash mapping while you enjoy a full sensory shower experience. The adjustable tension strap and ergonomic seal may help prevent moisture-related fallout, ensuring your look remains effortless and intact.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", "2 Pcs"];
products[216] = ["Cateyes Sunglasses", 24.95, "True Sight Vision", "Elevate your digital environment with eyewear crafted for the modern ritual. These precision-engineered lenses may help filter blue light frequencies, which may help support more natural sleep patterns after late-night screen use. Constructed with an emphasis on ergonomic balance, the ultra-light frames may help minimize temple pressure and physical fatigue. It is a thoughtful addition to your wellness routine that may help keep your vision feeling refreshed and your focus sharp.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", ""];
products[227] = ["BiFocal Reading Sunglasses", 29.99, "True Sight Vision", "Engineered with light-sensitive molecules, these adaptive lenses may help provide a seamless visual transition by darkening in bright sunlight and clearing indoors. This automatic adjustment may help reduce eye fatigue caused by sudden changes in lighting environments. By integrating two functions into a single frame, they may help simplify your daily routine while offering consistent UV protection.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", ""];
products[228] = ["Ski Goggles", 34.95, "True Sight Vision", "Integrated with open-ear bone conduction technology, these smart frames may help you stay connected to your music or calls while maintaining full situational awareness of your surroundings. The directional speakers may help minimize sound leakage, providing a more private listening experience during outdoor exercise. This hands-free design may help improve safety for runners and cyclists who need to hear ambient traffic noise while staying entertained.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", ""];
products[229] = ["Hiking Glass", 39.95, "True Sight Vision", "Featuring a precision amber tint, these polarized fishing glasses may help enhance visual contrast and depth perception when looking into the water. The specialized filter may help cut through surface glare, which may help you spot fish and underwater structures more effectively. This improved visibility may help reduce eye strain during long hours on the boat or shore, supporting a more productive day on the water.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", "2 Pcs"];
products[230] = ["Blue Light Blocking Gaming Glass", 44.95, "True Sight Vision", "Elevate your digital ritual with frames crafted from aerospace-grade materials. The durable aluminum-magnesium body and flexible carbon fiber temples offer a streamlined profile that may help minimize pressure points during prolonged device use. Designed with specialized amber lenses, this collection may help filter harmful blue light and provide comprehensive UV protection. Incorporating these into your evening routine may help support a more natural sleep cycle, ensuring you wake up refreshed and ready for the day ahead.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", ""];
products[231] = ["Swimming Glass", 49.95, "True Sight Vision", "Designed with a high-impact inner frame, these sports goggles may help provide a secure mounting point for custom prescription lenses. The integrated side ventilation may help promote consistent airflow, which may help prevent lens fogging during high-intensity sports like basketball or racquetball. Featuring an adjustable elastic headband, they may help maintain a stable fit during rapid movements, protecting your vision and your investment.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", ""];
products[232] = ["Multifunctional Eyewear Stand", 14.95, "True Sight Vision", "This product is designed to organize and display eyewear. The stand can hold 9 to 12 pairs of glasses and features a 360-degree rotating base for easy access. It also includes an additional tray with soft pads for storing various jewelry items. Made from durable metal with a matte finish, the stand has a modern, minimalist design. It is easy to assemble and has a compact footprint to save space on a desk or counter. The interior of the stand is lined with a soft, non-woven fabric to help protect items from scratches.", "
", 0,"By placing an order with us you will be charged $ __prc__ + $0.00 for S&H for __altnm__ of True Sight Vision __prdname__. If you are not completely satisfied with your purchase of True Sight Vision __prdname__ at any time, please call (888) 605-6258 or email contactus@truesightvision.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 truesightvision.com.", ""];
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, showFullCart) {
if (typeof showFullCart === "undefined") {
showFullCart = false;
}
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();
}
$.cookie('order', order);
$.cookie('orderedTotQty', orderedTotQty);
showCart(true, '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); 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] + " " + products[prodId][0] + " " + products[prodId][7] + "
" + "