// Blocklayered : Fix bug with ordering and some old theme

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12885 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-02-01 10:01:44 +00:00
parent 21bce7a4e4
commit c61fb6df53
+15 -1
View File
@@ -119,7 +119,9 @@ $(document).ready(function()
$('#selectPrductSort').unbind('change');
// To be sure there is no other events attached to the selectPrductSort, change the ID
$('#selectPrductSort').attr('onchange', '');
$('#selectPrductSort').attr('id', 'selectPrductSort2');
$('label[for=selectPrductSort]').attr('for', 'selectPrductSort2');
$('#selectPrductSort2').live('change', function(event) {
reloadContent();
});
@@ -306,7 +308,19 @@ function reloadContent(params_plus)
if ($('#selectPrductSort2').length)
{
var splitData = $('#selectPrductSort2').val().split(':');
if ($('#selectPrductSort2').val().search(/orderby=/) > 0)
{
// Old ordering working
var splitData = [
$('#selectPrductSort2').val().match(/orderby=(\w*)/)[1],
$('#selectPrductSort2').val().match(/orderway=(\w*)/)[1]
];
}
else
{
// New working for default theme 1.4 and theme 1.5
var splitData = $('#selectPrductSort2').val().split(':');
}
data += '&orderby='+splitData[0]+'&orderway='+splitData[1];
}