Xcart 4.1.8+ (and possibly earlier).
Possibly this should be in 3rd party mods, but this type of error will likely occur with lots of custom javascript and is really hard to track down partly due to the old style way that xcart scripts are scattered throughout the page.
If using Lytebox on your product pages and product variants you may well find that the price or stock quantity or variant images don't update when you make a new selection. This only occurs in IE (6 & 7), Firefox and Safari are fine.
The problem comes from the way Lytebox extends the array object, it adds 2 functions to the array object, which IE then includes when it iterates through the array of product variants in a "
for...in.." loop, this will cause IE to crash if you try to access a property/do something on those extra functions.
To get around this you can:
a) not use (insert name of 3rd party js code here)
b) check for object types as you iterate and skip the functions added to the arrays
eg An example of this is in /modules/Product_Options/func.js
Before:
Code:
function check_options() {
var local_taxes = [];
var is_rebuild_wholesale = false;
var variantid = false;
for (var t in taxes)
local_taxes[t] = taxes[t][0];
price = default_price;
/* Find variant */
for (var x in variants) {
if (variants[x][1].length == 0)
continue;
..........
After (new code in red, green is a comment line to debug with if you use firebug's console):
Code:
function check_options() {
var local_taxes = [];
var is_rebuild_wholesale = false;
var variantid = false;
for (var t in taxes)
local_taxes[t] = taxes[t][0];
price = default_price;
/* Find variant */
for (var x in variants) {
if (typeof(variants[x]) == "function") {
//console.warn("In func.js, skipping: "+typeof(variants[x]))
continue;
}
document.write("<Processing: "+typeof(variants[x])+"<br/>")
if (variants[x][1].length == 0)
continue;