Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Limit the number of items pagination shows?

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 11-22-2017, 01:30 PM
 
xcartuser1111 xcartuser1111 is offline
 

Newbie
  
Join Date: Feb 2016
Posts: 8
 

Default Limit the number of items pagination shows?

Currently, (and I think the default is) that the site shows 10 maximum items in the pagination list. Ex: If I have 22 pages of product, it looks like this:

< 1 2 3 4 5 6 ... 22 >


I would like to change this so that it shows 2 few items, to be this:

< 1 2 3 4 ... 22 >

Anyone done this or can point me in the right direction? I've spent a couple hours on this with no luck.

Thanks!
__________________
-Phil
Reply With Quote
  #2  
Old 11-26-2017, 10:29 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Limit the number of items pagination shows?

Here is the base class that pager widgets use:
\XLite\View\Pager\APager

I guess the method that you are to decorate is this one:
getPagesPerFrame()

So, you should check the ItemsList widget class that you want to customize the pager for, determine the pager class from the getPager() method in that widget class, and then decorate the getPagesPerFrame() method in the pager class.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 11-27-2017, 10:47 AM
 
xcartuser1111 xcartuser1111 is offline
 

Newbie
  
Join Date: Feb 2016
Posts: 8
 

Default Re: Limit the number of items pagination shows?

Thank you for your response. You guys are a lot smarter than me. Is there a document that describes decorating a class?
__________________
-Phil
Reply With Quote
  #4  
Old 11-27-2017, 11:59 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Limit the number of items pagination shows?

You can find a tutorial here:
https://devs.x-cart.com/getting_started/applying-logic-changes.html
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:00 AM.

   

 
X-Cart forums © 2001-2020