From 472dc8c27d8edc90e8c8d05515236cb1df27cf00 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 7 Nov 2013 17:59:04 +0100 Subject: [PATCH] [-] MO : Blocklayered follow up https://github.com/PrestaShop/PrestaShop/commit/a6e67b078e067445eef358e907649e843a1dc26a#commitcomment-4538556 --- modules/blocklayered/blocklayered.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/blocklayered/blocklayered.js b/modules/blocklayered/blocklayered.js index 0edae4fd8..e1ec5b2de 100644 --- a/modules/blocklayered/blocklayered.js +++ b/modules/blocklayered/blocklayered.js @@ -230,12 +230,11 @@ function initLayered() function paginationButton() { $('#pagination a').not(':hidden').each(function () { - if ($(this).attr('href').search(/&|\?p=/) == -1) { - var page = 1; - } - else { - var page = $(this).attr('href').replace(/^.*[&|\?]p=(\d+).*$/, '$1'); - } + if ($(this).attr('href').search(/[&|\?]p=/) == -1) + var page = 1; + else + var page = $(this).attr('href').replace(/^.*[&|\?]p=(\d+).*$/, '$1'); + var location = window.location.href.replace(/#.*$/, ''); $(this).attr('href', location+current_friendly_url.replace(/\/page-(\d+)/, '')+'/page-'+page); });