// Blocklayered: Fix bug with nb of products per pages + Change revision number

This commit is contained in:
mDeflotte
2012-03-13 15:52:21 +00:00
parent b96e420031
commit 1f3d5e8eba
3 changed files with 46 additions and 17 deletions
+42 -13
View File
@@ -115,14 +115,35 @@ $(document).ready(function()
hideFilterValueAction(this); hideFilterValueAction(this);
}); });
// Unbind event change on #selectPrductSort
$('#selectPrductSort').unbind('change');
// To be sure there is no other events attached to the selectPrductSort, change the ID // To be sure there is no other events attached to the selectPrductSort, change the ID
$('#selectPrductSort').attr('onchange', ''); var id = 1;
$('#selectPrductSort').attr('id', 'selectPrductSort2'); while ($('#selectPrductSort').length) { // Because ids are duplicated
$('label[for=selectPrductSort]').attr('for', 'selectPrductSort2'); // Unbind event change on #selectPrductSort
$('#selectPrductSort2').live('change', function(event) { $('#selectPrductSort').unbind('change');
$('#selectPrductSort').attr('onchange', '');
$('#selectPrductSort').addClass('selectPrductSort');
$('#selectPrductSort').attr('id', 'selectPrductSort'+id);
$('label[for=selectPrductSort]').attr('for', 'selectPrductSort'+id);
id++;
}
$('.selectPrductSort').live('change', function(event) {
$('.selectPrductSort').val($(this).val());
reloadContent();
});
// To be sure there is no other events attached to the nb_item, change the ID
var id = 1;
while ($('#nb_item').length) { // Because ids are duplicated
// Unbind event change on #nb_item
$('#nb_item').unbind('change');
$('#nb_item').attr('onchange', '');
$('#nb_item').addClass('nb_item');
$('#nb_item').attr('id', 'nb_item'+id);
$('label[for=nb_item]').attr('for', 'nb_item'+id);
id++;
}
$('.nb_item').live('change', function(event) {
$('.nb_item').val($(this).val());
reloadContent(); reloadContent();
}); });
@@ -306,23 +327,27 @@ function reloadContent(params_plus)
} }
}); });
if ($('#selectPrductSort2').length) if ($('.selectPrductSort').length)
{ {
if ($('#selectPrductSort2').val().search(/orderby=/) > 0) if ($('.selectPrductSort').val().search(/orderby=/) > 0)
{ {
// Old ordering working // Old ordering working
var splitData = [ var splitData = [
$('#selectPrductSort2').val().match(/orderby=(\w*)/)[1], $('.selectPrductSort').val().match(/orderby=(\w*)/)[1],
$('#selectPrductSort2').val().match(/orderway=(\w*)/)[1] $('.selectPrductSort').val().match(/orderway=(\w*)/)[1]
]; ];
} }
else else
{ {
// New working for default theme 1.4 and theme 1.5 // New working for default theme 1.4 and theme 1.5
var splitData = $('#selectPrductSort2').val().split(':'); var splitData = $('.selectPrductSort').val().split(':');
} }
data += '&orderby='+splitData[0]+'&orderway='+splitData[1]; data += '&orderby='+splitData[0]+'&orderway='+splitData[1];
} }
if ($('.nb_item').length)
{
data += '&n='+$('.nb_item').val();
}
var slideUp = true; var slideUp = true;
if (params_plus == undefined) if (params_plus == undefined)
@@ -358,8 +383,12 @@ function reloadContent(params_plus)
$('#product_list').css('opacity', '1'); $('#product_list').css('opacity', '1');
if ($.browser.msie) // Fix bug with IE8 and aliasing if ($.browser.msie) // Fix bug with IE8 and aliasing
$('#product_list').css('filter', ''); $('#product_list').css('filter', '');
if ($(result.pagination).find('ul.pagination').length)
$('ul.pagination').replaceWith($(result.pagination).find('ul.pagination'));
else
$('div#pagination').html($(result.pagination));
$('div#pagination').html(result.pagination);
paginationButton(); paginationButton();
ajaxLoaderOn = 0; ajaxLoaderOn = 0;
+1 -1
View File
@@ -39,7 +39,7 @@ class BlockLayered extends Module
{ {
$this->name = 'blocklayered'; $this->name = 'blocklayered';
$this->tab = 'front_office_features'; $this->tab = 'front_office_features';
$this->version = '1.8.1'; $this->version = '1.8.2';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->need_instance = 0; $this->need_instance = 0;
+3 -3
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<module> <module>
<name>blocklayered</name> <name>blocklayered</name>
<displayName><![CDATA[Bloc navigation &agrave; facettes]]></displayName> <displayName><![CDATA[Layered navigation block]]></displayName>
<version><![CDATA[1.8.1]]></version> <version><![CDATA[1.8.2]]></version>
<description><![CDATA[Affiche un bloc avec les filtres de la navigation &agrave; facettes]]></description> <description><![CDATA[Displays a block with layered navigation filters.]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab> <tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable> <is_configurable>1</is_configurable>