使用Prestashop 1.6.1.0我试图在Prestashops blocklayered模块中使用滑块作为价格范围,但价格不会更新,这是抛出的错误:
v_17_7c30367….js:2 Uncaught Error: cannot call methods on slider prior to initialization;
attempted to call method 'values'
我读过某个地方是因为旧版本的jquery。这是blocklayered.js文件
function addSlider(type, data, unit, format)
{
sliderList.push({
type: type,
data: data,
unit: unit,
format: format
});
}
function initSliders()
{
$(sliderList).each(function(i, slider){
$('#layered_'+slider['type']+'_slider').slider(slider['data']);
var from = '';
var to = '';
switch (slider['format'])
{
case 1:
case 2:
case 3:
case 4:
from = blocklayeredFormatCurrency($('#layered_'+slider['type']+'_slider').slider('values', 0), slider['format'], slider['unit']);
to = blocklayeredFormatCurrency($('#layered_'+slider['type']+'_slider').slider('values', 1), slider['format'], slider['unit']);
break;
case 5:
from = $('#layered_'+slider['type']+'_slider').slider('values', 0)+slider['unit']
to = $('#layered_'+slider['type']+'_slider').slider('values', 1)+slider['unit'];
break;
}
$('#layered_'+slider['type']+'_range').html(from+' - '+to);
});
}