0

instead of displaying “items 1-12 from 14 items total” i want to display like this “ items 12 from 14 items total “ how do i change this code to achieve this

    <div class="pager clearfix">
    <p class="amount-catalog">
        <?php echo $this->__('Items %s to %s of (%s) total', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
    </p>
   how do i change this code to achieve this
tali
  • 5
  • 1
  • 3

1 Answers1

0

What would happen if you are on page 3 and have "items 24 to 36 of 50 total" ? Anyway, the code to change that is:

<div class="pager clearfix">
<p class="amount-catalog">
    <?php echo $this->__('Items %s from (%s) items total', $this->getLastNum(), $this->getTotalNum()) ?>
</p>

But you should also add this text in your app/locale/en_US (and other languages)/Mage_Catalog.csv just like "Items %s from %s items total","Items %s from %s items total". Keep in mind my example is for english only, other languages will have the part after comma translated.

For more info look at this php function http://php.net/sprintf

Emi
  • 1,018
  • 9
  • 13
  • thank you for the quick response but now what happens :first page it displays like this "items 1 from 14 items total"(it should be 12) and the next page it displays "items 13 from 14 total"(it should be 14) – tali Aug 21 '13 at 11:03
  • Are you sure you're using `$this->getLastNum()` ? – Emi Aug 21 '13 at 11:54