title: Page limit and total number of pages in Magento
body: <p>I have pagination on my category page, however, I'm having a few problems with it. </p>
  
  <ol>
  <li><p>Supposedly, if you select the limit on the dropdown on the toolbar, the number of products that would display would change. Say if you select 20 on the dropdown, there should be 20 products on the first page instead of 5. However, after I've made some customizations on the paging (moved paging at the bottom of the list, added first and last buttons), this dropdown no longer works. Is there something I need to add or change in the code for this to work?</p></li>
  <li><p>I've added a text before the paging that says page n of n. Then, I made some changes on the php file to test how I can modify the limit dropdown. Then I changed the page then the limit. So there are instances wherein the page becomes Page 5 of 2. How can I fix this?</p></li>
  </ol>
  
  <p>Update: I've managed to fix problem 2 by making some comparisons so that one's fixed. For problem 1, I don't have much code to show since I didn't make any changes to toolbar.phtml where the dropdown is but anyway, here's the code inside phtml related to the limit.</p>
  
  <pre><code>&lt;select&gt;
              &lt;?php foreach ($this-&gt;getAvailableLimit() as  $_key=&gt;$_limit): ?&gt;
                  &lt;option value="&lt;?php echo $this-&gt;getLimitUrl($_key) ?&gt;"&lt;?php if($this-&gt;isLimitCurrent($_key)): ?&gt; selected="selected"&lt;?php endif ?&gt;&gt;
                      &lt;?php echo $_limit ?&gt;
                  &lt;/option&gt;
              &lt;?php endforeach; ?&gt;
          &lt;/select&gt;
  </code></pre>
  
  <p>With that code, the page is supposed to reload with ?limit=n on the url which means it will display n number of items per page but it's not.</p>