过滤器包含精确搜索按钮,页面加载根据search.But我想要的产品时,我选中复选框,该产品应display.This可以通过AJAX的方式来达到的..Opencart的阿贾克斯过滤器对于产品
原创脚本Opencart的2.1.0.2产品过滤
`<script type="text/javascript"><!--
$('#button-filter').on('click', function() {
filter = [];
$('input[name^=\'filter\']:checked').each(function(element) {
filter.push(this.value);
});
location = '<?php echo $action; ?>&filter=' + filter.join(',');
});
//--></script>
`
,我试图用ajax
`$(document).on('change','.sort_rang',function(){
filter = [];
$('input[name^=\'filter\']:checked').each(function(element) {
filter.push(this.value);
});
location = '<?php echo $action; ?>&filter=' + filter.join(',');
$.ajax({
type: "POST",
location: location,
success: function(data)
{
$('.products-block').html(data);
}
});
console.log;
return false;
});`
我得到了想要的结果。但它加载整个页面。如果可能的话,我如何使用任何加载器。
捞出来定义
location
'位置线' – thecodejack通过删除位置.Ajax部分不工作 –
或说'var location =' – thecodejack