*

pitbull

  • ***
  • 98 posts
Pagination BUG
« on: November 03, 2019, 01:30:24 AM »
Hi @Frosticek.

There is a bug in the pagination of seller items.

Example:

A seller has 100 items in 3 categories and the items per page are set to 20 in the plugin configuration.

so the pagination is like that:

1 2 3 4 5

When i filter the results per category (eg a category that contain 30 items) the pagination still remains

1 2 3 4 5

pages 3, 4, 5 are still displayed and clickable but there are empty as only 2 first pages (1 , 2) contain results. Page 1 has 20 results and page 2 has 10 results (Total 30 results).

How can i fix it so it will display only the pages that contain items ?

This is the code that display the pagination:

Code: [Select]
<?php if($count_items $per_page) { ?>
  <div id="bpr-pagination">
  <?php 
  $pages 
ceil($count_items/$per_page); 
  
$page_actual = ($current_page == '' $current_page);
  
?>



  <?php for ($i 1$i <= $pages$i++) { ?>
  <a href="<?php echo osc_route_url('bpr-seller-filter', array('identifier' => $identifier'params' => 'city,' $current_city ';category,' $current_cat ';page,' $i ';')); ?>" <?php if($page_actual == $i) { ?>class="bpr-active"<?php ?>><?php echo $i?></a>
  <?php ?>

  </div>
  <?php ?>

Also is there any way to add Next button or go to last item button as the default osclass pagination has ? Just think. What if a seller has many items??

Thanks and waiting for your valuable help.

*

pitbull

  • ***
  • 98 posts
Re: Pagination BUG
« Reply #1 on: November 06, 2019, 12:10:14 PM »
@Frosticek any fix tip ??

*

MB Themes

Re: Pagination BUG
« Reply #2 on: November 06, 2019, 03:40:31 PM »
@pitbull
I've just checked demo site and count items variable correctly counts listings.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

pitbull

  • ***
  • 98 posts
Re: Pagination BUG
« Reply #3 on: November 07, 2019, 06:42:28 AM »
@pitbull
I've just checked demo site and count items variable correctly counts listings.

The problem isn't in count. I said that if a seller has 100 listings and you as admin limit the pagination in the admin panel to lets say 10 listings per page the pagination will show 10 links (10x10) like that :
1 2 3 4 5 6 7 8 9 10
and this is normal and works absolutely fine.
BUT if you filter the results per category and lets say there are only 20 results the pagination links must be
1 2
and NOT
1 2 3 4 5 6 7 8 9 10

see what i mean ??

*

MB Themes

Re: Pagination BUG
« Reply #4 on: November 07, 2019, 02:28:39 PM »
Number of pages in footer is dependand on listing counter. (listing count / listings per page)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots