view all products to pager


/ Published in: PHP
Save to your folder(s)

File location: default -> template -> page -> html -> pager.phtml __or__ default -> template -> catalog -> product -> list -> toolbar.phtml


Copy this code and paste it in your HTML
  1. <!-- check if in view all mode: -->
  2. <?php $_limit = $this->getLimit(); ?>
  3. <?php $_viewAllMode = (strtolower($_limit) == 'all') ? true : false; ?>
  4.  
  5. <!-- back to normal pagination if in view all mode: -->
  6. <?php if ($_viewAllMode == true): ?>
  7. <?php $_itemsPerPage = 9 ?>
  8. <div class="pages">
  9. <a href="<?php echo $this->getLimitUrl($_itemsPerPage); ?>"><?php echo $this->__('View %d items per page', $_itemsPerPage) ?></a>
  10. </div>
  11. <?php endif; ?>
  12.  
  13.  
  14. <!-- show all code: -->
  15. <?php //Show all: ?>
  16. <a href="<?php echo $this->getLimitUrl('all'); ?>"><?php echo $this->__('View All') ?></a>
  17. &nbsp;&nbsp;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.