Jump to content

Do its own pagination


AmFaye
 Share

Recommended Posts

Hello

I added a module in prestashope. In this module I list information from a new table I created. I wish I could do pagination when displaying. For example suppose I have 100 data I want to display 10 per page.

 

Any idea?

Share this post


Link to post
Share on other sites

  • 11 months later...

i think u need to get understand how it works his own pagination

 

so u need to look at function in classes/controller/FrontController.php:

 

Function is :

 

public function pagination($nbProducts = 10)

{...

 

if you good in php you can understand how it works

Share this post


Link to post
Share on other sites

you should limit query for example, for 10 products.

for example: LIMIT x,10

 

where x = $_GET['page']

 

then create links with:

<a href=your.page.com/index.php?page=1>page 1</a>

<a href=your.page.com/index.php?page=2>page 2</a>

<a href=your.page.com/index.php?page=3>page 3</a>

...

etc.

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More