Jump to content

How to solve the conflict of top and bottom pagination in product-list?


Recommended Posts

Hello Sir/Madam,

Could somebody please teach me how to solve the conflict of top and bottom pagination in product-list? I have a top and bottom pagination in the product-list, but when I click on whatever button of that, the top pagination bar will be hiding. I am using PS1.4.8.3.

 

I looked into the category.tpl and found the code:

 

{if $products}

<div class="content_sortPagiBar">

{include file="$tpl_dir./pagination.tpl"}

<div class="sortPagiBar clearfix">

{include file="$tpl_dir./product-sort.tpl"}

{include file="$tpl_dir./product-compare.tpl"}

{include file="$tpl_dir./nbr-product-page.tpl"}

</div>

</div>

 

{include file="$tpl_dir./product-list.tpl" products=$products}

 

<div class="content_sortPagiBar">

{include file="$tpl_dir./pagination.tpl"}

<div class="sortPagiBar clearfix">

{include file="$tpl_dir./product-sort.tpl"}

{include file="$tpl_dir./product-compare.tpl"}

{include file="$tpl_dir./nbr-product-page.tpl"}

</div>

</div>

 

I tried to modify among those codes, but it is useless. I think it should be the pagination ajax setting problem. I have no idea where to correct this problem. Please give me a hand. Thank you very much.

 

Best regards,

Derox

Edited by deroxonweb (see edit history)
Link to comment
Share on other sites

if you are using blocklayered, the problem lies in the blocklayered.js code that is written to handle only one pagination element.

 

simplest hack would be to include second pagination.tpl with other id than "pagination" (for example, "pagination2"),

(including second pagination template with a parameter, like here products variable is passed)

{include file="$tpl_dir./product-list.tpl" products=$products}

 

and then duplicate relevant blocklayered.js functions (everywhere there is invocation to "#pagination", copy all code and change id to "#pagination2").

Link to comment
Share on other sites

  • 3 weeks later...

Hello Sir,

I followed the way to change the second pagination.tpl in category.tpl to paginationtop.tpl, and duplicate all the blocklayered.js functions (I have changed the #pagination to #paginationtop). The conflict of the top and bottom pagination has been solved. But when I click on the block layer function to narrow a result, the page will remain loading only... so I disable the loader function. But whatever of that, when I remove the filter checkbox, the result will remain the same only, does not change or filter again.

 

Could you please teach me how to solve this problem? Or anything I have done in the wrong way?

 

I copy all the code in blocklayered.js. from:

------------------------------------------------------------------

var ajaxQueries = new Array();

var ajaxLoaderOn = 1;

var sliderList = new Array();

var slidersInit = false;

 

$(document).ready(function()

{

cancelFilter();

openCloseFilter();

---------------------------------------------------------------

 

to the bottom and paste it in the same file. Then I only find the #pagination and changed all to #paginationtop. Is it true? Please help, thank you very much.

Edited by deroxonweb (see edit history)
Link to comment
Share on other sites

well, you have gone too easy on blocklayered.js

 

the trick is not just to duplicate whole code - you need only to duplicate code related to #pagination.

so take the original .js and try to understand where line of code starts with #pagination. It can be difficult as jquery has chained functions. anyway this is the way to do it. disabling "loader" function effectively disabled whole loading of new products AFAIK - you shouldnt disable anything if you dont know what it is.

 

after some bit more little thinking (I'm just learning like you):

 

in jquery you can select multiple elements. so perhaps this time try not to duplicate the lines, just change the jquery selection from ('#pagination') to ('#pagination,#paginationtop') - but keep them working, this is just a example! see http://api.jquery.com/multiple-selector/

 

good luck!

 

PS after weekend I will be back online

Edited by devein (see edit history)
Link to comment
Share on other sites

Hi Sir,

I tried to change the jquery selection from ('#pagination') to ('#pagination,#paginationtop'), the price range filter will be errored, and when I remove the filter checkbox, the top pagination bar when be disappeared again. Is there a way to solve this problem?

 

I tried to only duplicate the related #pagination code and change it to #paginationtop, but the filter will not loading at all. I am so nervous of this problem. Could you please upload me a proper blocklayered.js file that can solved this problem? The filter function is very important to my site activity, please give me a hand. Thank you very much.

 

Best regards,

Derox

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...