문제

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
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top