Option Combination bug

I have just posted a bug report: [url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=1826[/url], regarding an intermittant problem with the Product Option selectors (combo boxes).



However, I am a bit of a newbie to CS-Cart (though I have many years experience of software development) and am not at all sure as to how I would produce a temporary fix for this type of problem, I can think of several ways, both in the php and in the javascript to produce a fix, but am not confident that they would not produce some unexpected side effect!!!



Is there anyone out there that has the time to look at the temporary fix I am thinking of doing and could give me a quick thumbs up or down if they think that it would be sensible?



Original Code

--------------------

for (var i in combination_parts) {

if (key_parts[combination_parts[i]]) {

key += (key != ‘’ ? ‘’ : ‘’) + combination_parts[i] + '’ + key_parts[combination_parts[i]];

}

}



Suggested Solution

-----------------------------

var control = true; // VHC - Used to prevent alternate combination parts

for (var i in combination_parts) {

if (control) {

// VHC - Allow this combination parts but prevent the next one!

control = false;

if (key_parts[combination_parts[i]]) {

key += (key != ‘’ ? '
’ : ‘’) + combination_parts[i] + '
’ + key_parts[combination_parts[i]];

}

} else {

// VHC - Allow the next combination _partsto be processed!

control = true;

}

}

Just a quick update for anyone interested in this problem!



I have now tested and implemented the fix as shown above. It seems to work perfectly and I have not (as yet!) seen any unexpected problems with it!