Hi Julie, the problem with my last fix
<script type="text/javascript">
$('#optn0x0y0, #optn0x0y1, #optn0x0y2, #optn0x0y3, #optn0x0y4, #optn0x0y5, #optn0x0y6, #optn0x0y7, #optn0x0y8, #optn0x0y9, #optn0x0y10').text(function (_,txt) {
return txt.slice(0, -1);
});
</script>
<script type="text/javascript">
function updateoptimage(){
$('#optn0x0y0, #optn0x0y1, #optn0x0y2, #optn0x0y3, #optn0x0y4, #optn0x0y5, #optn0x0y6, #optn0x0y7, #optn0x0y8, #optn0x0y9, #optn0x0y10').text(function (_,txt) {
return txt.slice(0);
});
}
</script>
was the function there in red (updateoptimage) is the ect function that changes the image, allows dependent options to work, and changes your pricing.
Be me adding that function again further down the page, it caused the first one to stop working.
My understanding is if it's listed twice on the page, then the 2nd one takes priority.
I worked on several solutions and it's tricky detecting a radio button change to call the function that chops off the last letter.
The ect code has a built in trigger that calls up the updateoptimage function.
In the end I just copied the ect function and added in the part there that cuts off the last letter.
So when the updateoptimage function is requested, it is using the new one I created.
It all seems to work fine in my testing. I checked several browsers.
It's updaterproof, but if ect ever adds something to that function (updateoptimage) then you may not have the feature until we update this hack.
I am sure there are lots of ways to do this, but it does seem to work.
Alternately, you can do a hack (not updater-proof) in the core code.
Below is what you want now
<script type="text/javascript">
$('#optn0x0y0, #optn0x0y1, #optn0x0y2, #optn0x0y3, #optn0x0y4, #optn0x0y5, #optn0x0y6, #optn0x0y7, #optn0x0y8, #optn0x0y9, #optn0x0y10').text(function (_,txt) {
return txt.slice(0, -1);
});
</script>
<script type="text/javascript">
function updateoptimage(theitem,themenu,opttype){
var imageitemsrc='',mzitem,theopt,theid,imageitem,imlist,imlistl,fn=window['updateprice'+theitem];
dependantopts(theitem);
fn();
$('#optn0x0y0, #optn0x0y1, #optn0x0y2, #optn0x0y3, #optn0x0y4, #optn0x0y5, #optn0x0y6, #optn0x0y7, #optn0x0y8, #optn0x0y9, #optn0x0y10').text(function (_,txt) {
return txt.slice(0, -1);
});
if(opttype==1){
theopt=document.getElementsByName('optn'+theitem+'x'+themenu)
for(var i=0; i<theopt.length; i++)
if(theopt[i].checked)theid=theopt[i].value;
}else{
theopt=document.getElementById('optn'+theitem+'x'+themenu)
theid=theopt.options[theopt.selectedIndex].value;
}
if(mzitem=(document.getElementById("zoom1")?document.getElementById("zoom1"):document.getElementById("mz"+(globalquickbuyid!==''?'qb':'prod')+"image"+theitem))){
if(aIML[theid]){
MagicZoom.update(mzitem,vsdecimg(aIML[theid]),vsdecimg(aIM[theid]));
}else if(pIM[0]&&pIM[999]){
imlist=pIM[0].split('*');imlistl=pIM[999].split('*');
for(var index=0;index<imlist.length;index++)
if(imlist[index]==aIM[theid]&&imlistl[index]){MagicZoom.update(mzitem.id,vsdecimg(imlistl[index]),vsdecimg(aIM[theid]));return;}
if(aIM[theid])MagicZoom.update(mzitem.id,vsdecimg(aIM[theid]),vsdecimg(aIM[theid]));
}else if(aIM[theid])
MagicZoom.update(mzitem.id,vsdecimg(aIM[theid]),vsdecimg(aIM[theid]));
}else
if(imageitem=document.getElementById((globalquickbuyid!==''?'qb':'prod')+"image"+theitem)){
if(aIM[theid]){
if(typeof(imageitem.src)!='unknown')imageitem.src=vsdecimg(aIM[theid]);
}
}
}
David
ECT Power User