Page limit and total number of pages in Magento -
i have pagination on category page, however, i'm having few problems it.
supposedly, if select limit on dropdown on toolbar, number of products display change. if select 20 on dropdown, there should 20 products on first page instead of 5. however, after i've made customizations on paging (moved paging @ bottom of list, added first , last buttons), dropdown no longer works. there need add or change in code work?
i've added text before paging says page n of n. then, made changes on php file test how can modify limit dropdown. changed page limit. there instances wherein page becomes page 5 of 2. how can fix this?
update: i've managed fix problem 2 making comparisons one's fixed. problem 1, don't have code show since didn't make changes toolbar.phtml dropdown anyway, here's code inside phtml related limit.
<select> <?php foreach ($this->getavailablelimit() $_key=>$_limit): ?> <option value="<?php echo $this->getlimiturl($_key) ?>"<?php if($this->islimitcurrent($_key)): ?> selected="selected"<?php endif ?>> <?php echo $_limit ?> </option> <?php endforeach; ?> </select>
with code, page supposed reload ?limit=n on url means display n number of items per page it's not.
i've managed fix both problems. hope helps else.
for problem 1. compared toolbar.phtml file server i'm working on , toolbar.phtml older project working. apparently, select tag replaced onchange method missing. added
onchange="setlocation(this.value)"
on select tag , worked.
for problem 2, since compared current page value of last page made modifications accordingly. like:
<?php if($toolbar->getcurrentpage() > $toolbar->getlastpagenum()) { ?>
Comments
Post a Comment