X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Limit the number of items pagination shows? (https://forum.x-cart.com/showthread.php?t=75807)

xcartuser1111 11-22-2017 01:30 PM

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!

qualiteam 11-26-2017 10:29 PM

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.

xcartuser1111 11-27-2017 10:47 AM

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?

qualiteam 11-27-2017 11:59 PM

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


All times are GMT -8. The time now is 06:10 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.