Forum Forum Magento Theme SNS Riveshop – Magento Theme Product Page Product Options Error

  • Author
    Posts
  • #473

    adrian
    Participant

    Hi,

    There is an error on the front end of all pages with advanced product options. PLEASE HELP AND FIX!

    e.g
    https://lizardlicklighting.com/lsi-xlcm-slice-exterior-led-area-light-xlcm-5-ft-led-ho-ss-cw-ue-wht-blk-brz-gmg.html

    ‘+ ”; } }.bind(this)); } }.bind(this)); imageBox.innerHTML = imageHTML; imageBox.show(); } else if (imageMode==4) { // Overlay Main Image var mainImage = this.getMainImage(); if (mainImage) { if (!mainImage.src) { mainImage = mainImage.down(‘img’); if (!mainImage) return; } // remove prev overlay_image if (el.type==’radio’) { var radios = el.up(2).getElementsByClassName(‘radio’); for (i=0; i 0) && image[1]) { var overlayImageId = ‘overlay_image_’ + optionValueId; var overlayImage = $(overlayImageId); if (!overlayImage) { mainImage.up(1).style.position = ‘relative’; var overlayImage = new Image(); overlayImage.width = mainImage.width; overlayImage.height = mainImage.height; overlayImage.style.display = ‘none’; overlayImage.style.position = ‘absolute’; overlayImage.style.top = 0; overlayImage.style.left = 0; overlayImage.style.zIndex = this.overlayZIndex; this.overlayZIndex++; overlayImage.id = overlayImageId; overlayImage.src = image[1]; Element.insert(mainImage, {‘after’:overlayImage}); overlayImage.show(); } } }.bind(this)); } }.bind(this)); } } } else { // replace and append variant var ul = $$(this.ulId.join(‘, ‘)).first(); var optionClass = ‘option-image-‘+optionId; if (el.type==’checkbox’) optionClass += ‘-‘ + el.value; var productImageLis = $$(this.ulId.join(‘ li.li-product-image, ‘) + ‘ li.li-product-image’); // hide product gallery if (imageMode==2 && productImageLis) { productImageLis.each(function(li) { li.hide(); }); } // remove option images $$(‘li.’ + optionClass).each(function(li) { li.remove(); }); if (typeof(ProductMediaManager)==’undefined’) { $$(‘img.’ + optionClass).each(function(img) { img.remove(); }); } // set default main image this.newMainImageUrl = this.mainImageUrl; this.newMainImageTitle = this.mainImageTitle; this.newMainImageThumbnail = this.mainImageThumbnail; this.newMainImageIndex = 0; if (((el.type==’checkbox’ || el.type==’radio’) && el.checked && !el.disabled) || ((el.type==’select-one’ || el.type==’select-multiple’) && el.value!=”)) { var liHtml = ”; if (ul) { // var li = ul.down(‘li’); var li = productImageLis.last(); if (this.dataImageIndex===false) this.dataImageIndex = $$(this.ulId.join(‘ li, ‘) + ‘ li’).length; if (li) { liHtml = ul.down(‘li’).innerHTML; liHtml = liHtml.replace(/(data\-image\-index\=[\’\”])[0-9]+?([\’\”])/,”$1{{data_image_index}}$2″); if (typeof(ProductMediaManager)==’undefined’) liHtml = liHtml.replace(/https?\:\/\/.+?([\’\”])/,”{{big_image_url}}$1″); liHtml = liHtml.replace(/https?\:\/\/.+?([\’\”])/g,”{{small_image_url}}$1″); liHtml = liHtml.replace(/(\s(?:title|alt)\=[\’\”]).*?([\’\”])/g,”$1{{title}}$2″); liHtml = ‘
    ‘ + liHtml + ‘
    ‘; } } var imageBox = $(‘customoptions_images_’ + optionId); if (imageBox) imageBox.hide(); // append option images elValueArr.each(function(optionValueId) { if (optionValueId!=” && opConfig.config[optionId][optionValueId] && opConfig.config[optionId][optionValueId].images) { opConfig.config[optionId][optionValueId].images.each(function(image, index) { if ((excludeFirstImage==0 && index==0) || index > 0) { if (liHtml) { if (image[1]) { imageHTML += liHtml.replace(new RegExp(“{{data_image_index}}”,’g’), this.dataImageIndex).replace(new RegExp(“{{big_image_url}}”,’g’), image[1]).replace(new RegExp(“{{small_image_url}}”,’g’), image[0]).replace(new RegExp(“{{title}}”,’g’), opConfig.config[optionId][optionValueId].title); if (typeof(ProductMediaManager)!=’undefined’) mainImageHTML += ”; this.dataImageIndex++; } } else { if (index==0 || (excludeFirstImage==1 && index==1)) { this.newMainImageUrl = image[1]; this.newMainImageThumbnail = image[1]; this.newMainImageTitle = opConfig.config[optionId][optionValueId].title; } } } else if (el.type==’select-one’ || el.type==’select-multiple’) { if (imageBox) { imageBox.hide(); imageBox.innerHTML = ”+ ”+ ”;; imageBox.show(); } } }.bind(this)); } }.bind(this)); if (imageHTML) ul.innerHTML += imageHTML; // for ProductMediaManager if (mainImageHTML) { var mainImageDiv = this.getMainImage().up(‘div’); if (mainImageDiv) mainImageDiv.innerHTML += mainImageHTML; } } // show product gallery if (!this.hasOptionImages() && productImageLis) { productImageLis.each(function(li) { li.show(); }); } $$(‘.cloud-zoom-gallery’).each(function(a) { if (a.up(‘li’).style.display==”) a.up(‘li’).style.display = ‘list-item’; }); if (typeof(ProductMediaManager)!=’undefined’) ProductMediaManager.init(); // change main image if (imageMode==2) { if (typeof(ProductMediaManager)==’undefined’) this.changeMainImage(); else setTimeout(‘optionImages.changeMainImage()’, 100); } } }, markProduct: function() { $$(this.ulId.join(‘ li, ‘) + ‘ li’).each(function(li) { li.addClassName(‘li-product-image’); }); if (this.mainImageUrl==”) { var mainImage = this.getMainImage(); if (mainImage) { if (mainImage.hasClassName(‘MagicToolboxContainer’)) { var elA = mainImage.down(‘a’); if (elA) { this.mainImageUrl = elA.href; var elImg = elA.down(‘img’); if (elImg.width) this.mainImageWidth = elImg.width; this.mainImageThumbnail = elImg.src; this.mainImageTitle = elImg.alt; } } else if (mainImage.hasClassName(‘zoom-image’) || (mainImage.up(‘a’) && mainImage.up(‘a’).hasClassName(‘cloud-zoom’))) { // Easy Zoom 1.0 – jQuery plugin // Cloud Zoom V1.0.2 var elA = mainImage.up(‘a’); if (elA) { this.mainImageUrl = elA.href; } else { this.mainImageUrl = mainImage.src; } this.mainImageTitle = mainImage.alt; this.mainImageThumbnail = mainImage.src } else { this.mainImageUrl = mainImage.src; this.mainImageTitle = mainImage.alt; } } } this.prevMainImageUrl = this.mainImageUrl; }, getMainImage: function() { return $$(‘div.product-img-box div.MagicToolboxContainer’, ‘div.product-img-box div.main-image img’, ‘div.product-img-box .product-image img’, ‘#image’, ‘#image-main’, ‘div.img-box .product-image img’).first(); }, changeMainImage: function() { if (!this.newMainImageUrl || this.newMainImageUrl==this.prevMainImageUrl) return; var mainImage = this.getMainImage(); if (!mainImage) return; if (!this.pageLoaded) { mainImage.hide(); setTimeout(‘optionImages.changeMainImage()’, 100); return; } if (typeof(ProductMediaManager)!=’undefined’) { $$(this.ulId.join(‘ li, ‘) + ‘ li’).each(function(li) { var elA = li.down(‘a’); if (elA && elA.readAttribute(‘data-image-index’)==this.newMainImageIndex) { elA.click(); } }.bind(this)); } else if (mainImage.hasClassName(‘MagicToolboxContainer’)) { var elA = mainImage.down(‘a’); if (elA) { elA.down(‘img’).width = this.mainImageWidth; MagicZoomPlus.update(elA.id, this.newMainImageUrl, this.newMainImageThumbnail, ‘show-title: false; drag-mode: false’); } } else if (mainImage.hasClassName(‘zoom-image’)) { // Easy Zoom 1.0 – jQuery plugin var elA = mainImage.up(‘a’); if (elA) elA.href = this.newMainImageUrl; mainImage.src = this.newMainImageUrl; mainImage.alt = this.newMainImageTitle; mainImage.title = this.newMainImageTitle; jQuery(‘#zoom’).easyZoom({parent: ‘div.zoom-container’, preload: ”, lightboxBtn: ‘.lightbox-btn .lightbox’}).data(‘easyZoom’).gallery(‘a.zoom-thumbnail’); } else if (mainImage.up(‘a’) && mainImage.up(‘a’).hasClassName(‘cloud-zoom’)) { // ultimo + Cloud Zoom V1.0.2 var elA = mainImage.up(‘a’); if (elA) elA.href = this.newMainImageUrl; mainImage.src = this.newMainImageUrl; mainImage.alt = this.newMainImageTitle; mainImage.title = this.newMainImageTitle; if ($(“zoom-btn”)) { $(“zoom-btn”).href = this.newMainImageUrl; $(“zoom-btn”).title = this.newMainImageTitle; } jQuery(“#”+elA.id).CloudZoom(); $$(‘.cloud-zoom-gallery’).each(function(a) { a.addClassName(‘cboxElement’); jQuery(a).CloudZoom(); }); } else { mainImage.src = this.newMainImageUrl; mainImage.alt = this.newMainImageTitle; mainImage.title = this.newMainImageTitle; } this.prevMainImageUrl = this.newMainImageUrl; mainImage.show(); }, hasOptionImages: function() { var result = false; var firstImageUrl = ”; $$(this.ulId.join(‘ li, ‘) + ‘ li’).each(function(li) { if (li.hasClassName(‘li-product-image’)==false) { // change main image if (!firstImageUrl) { var firstImageMatch = li.innerHTML.match(/(https?\:\/\/.+?)[\’\”]/); if (firstImageMatch) firstImageUrl = firstImageMatch[1]; this.newMainImageUrl = firstImageUrl; this.newMainImageThumbnail = firstImageUrl; this.newMainImageTitle = li.down(‘img’).alt; if (typeof(ProductMediaManager)!=’undefined’) this.newMainImageIndex = li.down(‘a’).readAttribute(‘data-image-index’); } result = true; } }.bind(this)); return result; } }; Event.observe(window, ‘load’, function() { opConfig.reloadPrice(); }); var dependentOptions = { dependentData: {“133″:[3538904,3538903],”134″:[3538904,3538903],”135″:[3538922,3538923],”136″:[3538922,3538923],”137″:[3538906,3538907],”138″:[3538906,3538907],”139″:[3538908,3538909,3538910,3538911,3538912,3538913,3538914,3538919,3538920,3538921],”140″:[3538908,3538909,3538910,3538911,3538912,3538913,3538914,3538919,3538920,3538921],”141″:[3538925,3538926],”142″:[3538925,3538926],”143″:[3538925,3538926],”144″:[3538925,3538926],”145″:[3538925,3538926],”146″:[3538925,3538926],”147″:[3538925,3538926],”148″:[3538925,3538926],”149″:[3538925,3538926],”151″:[3538927,3538928],”150”:[3538927,3538928]}, inGroupIdData: {“3538904”:{“dependency”:1,”select_52″:”135″},”3538903″:{“dependency”:1,”select_52″:”136″},”3538922″:{“dependency”:1,”select_53″:”137″},”3538923″:{“dependency”:1,”select_53″:”138″},”3538906″:{“dependency”:1,”select_54″:”139″},”3538907″:{“dependency”:1,”select_54″:”140″},”3538908″:{“dependency”:1,”select_55″:”141″},”3538909″:{“dependency”:1,”select_55″:”142″},”3538919″:{“dependency”:1,”select_55″:”143″},”3538921″:{“dependency”:1,”select_55″:”144″},”3538910″:{“dependency”:1,”select_55″:”145″},”3538911″:{“dependency”:1,”select_55″:”146″},”3538912″:{“dependency”:1,”select_55″:”147″},”3538914″:{“dependency”:1,”select_55″:”148″},”3538920″:{“dependency”:1,”select_55″:”149″}}, defaultData: [], dependentChanges: {“m”:[], “d”:[]}, dependentHide: false, select: function(el) { var i, ii = 0; if (el.type==’radio’) { var radios = this.upDiv(el).getElementsByClassName(‘radio’); for (i=0; i 0) { // prepare value var elValueArr = []; if (el.multiple) { for (i=0; i backup default options and clear if (!this.dependentChanges[‘d’][dElementId][‘options’]) { this.dependentChanges[‘d’][dElementId][‘options’] = []; var opSelected = false; for (ii=0; ii = this.inGroupIdData[IGI].dependency) || ((dElement.type==’select-one’ || dElement.type==’select-multiple’) && this.dependentChanges[‘d’][dElementId][‘options’][selectValue] && this.dependentChanges[‘d’][dElementId][‘options’][selectValue][‘use’].length >= this.inGroupIdData[IGI].dependency)) { // set visibility if (!this.inGroupIdData[IGI].out_of_stock) dElement.disabled = false; if (this.dependentHide && this.inGroupIdData[IGI].view_mode!=2) { if (dElement.type==’checkbox’ || dElement.type==’radio’) { $(dElement).up(‘li’).style.display = ‘block’; } dependentOptions.upDiv(dElement).style.display = ‘block’; } // set class required-entry if (isRequire) { $(dElement).removeClassName(‘required-dependent’); if (dElement.type==’checkbox’ || dElement.type==’radio’) { $(dElement).addClassName(‘validate-one-required-by-name’); } else { $(dElement).addClassName(‘required-entry’); } } // add or init dependent element if ((dElement.type==’select-one’ || dElement.type==’select-multiple’) && !$(dElement).hasClassName(‘datetime-picker’)) { // if [multi]select var selectValue = ‘s’+this.inGroupIdData[IGI][dElementId]; if (this.dependentChanges[‘d’][dElementId][‘options’][selectValue]) { dSelects.push(dElement); // after add data to this [multi]select } } else { // if radio, checkbox, text, etc. if (this.defaultData[dElementId] && ($(dElementId).type==’checkbox’ || $(dElementId).type==’radio’) && this.inGroupIdData[IGI].dependency==this.dependentChanges[‘d’][dElementId][‘use’].length) $(dElementId).click(); } } } } } } }.bind(this)); } if (dSelects.length>0) { for (i=0; i 0) { this.dependentChanges[‘d’][dElementId][‘options’][opValue][‘use’] = this.dependentChanges[‘d’][dElementId][‘options’][opValue][‘use’].without(mElementId); if (this.dependentChanges[‘d’][dElementId][‘options’][opValue][‘use’].length 1 || (dElement.multiple && dElement.length>0))) disableElFlag = false; dElement.onchange(); } else { // to radio, checkbox, text, etc. if (this.dependentChanges[‘d’][dElementId][‘use’] && this.dependentChanges[‘d’][dElementId][‘use’].length > 0) { this.dependentChanges[‘d’][dElementId][‘use’] = this.dependentChanges[‘d’][dElementId][‘use’].without(mElementId); if (this.dependentChanges[‘d’][dElementId][‘use’].length >= this.dependentChanges[‘d’][dElementId][‘dependency’]) disableElFlag = false; } } if (disableElFlag) { dElement.disabled = true; // restore default if [multi]select if ((dElement.type==’select-one’ || dElement.type==’select-multiple’) && !$(dElement).hasClassName(‘datetime-picker’)) { for(var opValue in this.dependentChanges[‘d’][dElementId][‘options’]) { if (!this.dependentChanges[‘d’][dElementId][‘options’].hasOwnProperty(opValue) || !this.dependentChanges[‘d’][dElementId][‘options’][opValue]) continue; var newOpt = new Option(this.dependentChanges[‘d’][dElementId][‘options’][opValue][‘text’], opValue.substr(1)); newOpt.disabled = this.dependentChanges[‘d’][dElementId][‘options’][opValue][‘disabled’]; newOpt.selected = this.dependentChanges[‘d’][dElementId][‘options’][opValue][‘sel-def’]; dElement.options.add(newOpt); } dElement.onchange(); } // hide if (this.dependentHide) { var hideDivFlag = true; if (dElement.type==’checkbox’ || dElement.type==’radio’) { $(dElement).up(‘li’).style.display = ‘none’; ulEl = $(dElement).up(‘li’).up(‘ul’); if (ulEl) { lis = ulEl.getElementsByTagName(‘li’); for (i=0; i dependent etc.. if (disableElFlag && (dElement.type==’checkbox’ || dElement.type==’radio’) && dElement.checked) { dElement.checked = false; if (dElement.type==’checkbox’) optionSetQtyProduct.checkboxQty(dElement); dependentOptions.returnSelect(dElement); } else if ((dElement.type==’select-one’ || dElement.type==’select-multiple’) && !$(dElement).hasClassName(‘datetime-picker’)) { dependentOptions.select(dElement); // that’s right! } else if (disableElFlag && (dElement.type==’text’ || dElement.type==’textarea’ || dElement.type==’file’)) { if (this.defaultData[dElementId]) dElement.value = this.defaultData[dElementId]; else dElement.value = ”; } } delete this.dependentChanges[‘m’][mElementId]; } }, rememberNewSelected: function(dElement, dElementId) { // remember new selected if (this.dependentChanges[‘d’][dElementId] && this.dependentChanges[‘d’][dElementId][‘options’]) { var opSelected = false; for (i=0; i 0) opSelected = true; else opSelected = false; this.dependentChanges[‘d’][dElementId][‘options’][‘s’+dElement.options[i].value][‘selected’] = opSelected; } } } }, // for ie to work upDiv: function(el) { if (el.type==’checkbox’ || el.type==’radio’) return el.up(4); else return el.up(‘div.option’); }, decorateIsLast: function() { var divs = $$(‘div.option’); if (divs) { var dl = false; var dd = false; divs.each(function(div, index){ if (div.style.display!=’none’ && !$(div).hasClassName(‘hidden’)) { dl = div.down(‘dl’); if (dl) { if ($(dl).hasClassName(‘last’)) $(dl).removeClassName(‘last’); dd = dl.down(‘dd’); if (dd && $(dd).hasClassName(‘last’)) $(dd).removeClassName(‘last’); } } }.bind(this)); if (dl) $(dl).addClassName(‘last’); if (dd) $(dd).addClassName(‘last’); } }, applyDefaultValues: function(el) { for(var elementId in this.defaultData) { if (!this.defaultData.hasOwnProperty(elementId)) continue; if ($(elementId) && this.upDiv($(elementId)) && this.upDiv($(elementId)).style.display!=”none”) { this.returnSelect($(elementId)); if ($(elementId).type==’select-one’ || $(elementId).type==’text’ || $(elementId).type==’textarea’) { $(elementId).value = this.defaultData[elementId]; } else if ($(elementId).type==’select-multiple’) { el = $(elementId); for (i=0; i
    Distribution Type *
    What Distribution Throw would you like?

    Drive Current *
    The Brighter the better

    Kelvin Color Temperature *
    Kelvin Temperature Color

    Voltage *
    Choose your Voltage?

    Finish *
    What Fixture Color Matches Your Pole?
    Buff Cream – +$30.00 White
    Dimming *

    PhotoCell *
    Regulates operational daylight times for automation and energy saving

You must be logged in to reply to this topic. Click here to login or register