// 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:
@@ -119,7 +119,9 @@ $(document).ready(function()
|
|||||||
$('#selectPrductSort').unbind('change');
|
$('#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', '');
|
||||||
$('#selectPrductSort').attr('id', 'selectPrductSort2');
|
$('#selectPrductSort').attr('id', 'selectPrductSort2');
|
||||||
|
$('label[for=selectPrductSort]').attr('for', 'selectPrductSort2');
|
||||||
$('#selectPrductSort2').live('change', function(event) {
|
$('#selectPrductSort2').live('change', function(event) {
|
||||||
reloadContent();
|
reloadContent();
|
||||||
});
|
});
|
||||||
@@ -306,7 +308,19 @@ function reloadContent(params_plus)
|
|||||||
|
|
||||||
if ($('#selectPrductSort2').length)
|
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];
|
data += '&orderby='+splitData[0]+'&orderway='+splitData[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user