3

Is there any way to count how many pages there is in pagination? I'm not talking about Collection count, but something like pagination count maybe?

1

1 Answer 1

7

A pagination is linked to a collection. To get the total number of pages use this:

$collection->getLastPageNumber();

If you have a pagination block in your page you can get the last page number like this:

$block->getLastPageNum();
1
  • I know magento-stackexchange want me to avoid thanks, but i say it anyway, thank you - it was exactly what i needed :)
    – simond
    Sep 28, 2013 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.