【问题标题】:magento configure pager list?magento 配置寻呼机列表?
【发布时间】:2013-08-21 08:25:25
【问题描述】:

而不是显示“总共 14 项中的第 1-12 项” 我想像这样显示“总共 14 项中的 12 项” 我如何更改此代码以实现此目的

    <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

【问题讨论】:

    标签: magento configure product pager


    【解决方案1】:

    如果您在第 3 页并且有“总共 50 项中的第 24 到 36 项”会发生什么? 无论如何,要更改的代码是:

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

    但您还应该在您的 app/locale/en_US(和其他语言)/Mage_Catalog.csv 中添加此文本,就像 "Items %s from %s items total","Items %s from %s items total" 一样。请记住,我的示例仅适用于英文,其他语言将翻译逗号后的部分。

    更多信息请查看这个 php 函数http://php.net/sprintf

    【讨论】:

    • 感谢您的快速响应,但现在会发生什么:第一页显示如下“总共 14 项中的第 1 项”(应该是 12 项),下一页显示“第 14 项中的第 13 项总计”(应该是 14)
    • 您确定您使用的是$this-&gt;getLastNum() 吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-18
    • 1970-01-01
    • 1970-01-01
    • 2011-03-31
    相关资源
    最近更新 更多