【问题标题】:Magento pagination is not displaying on Catalog pageMagento 分页未显示在目录页面上
【发布时间】:2017-02-23 09:22:05
【问题描述】:

在我的 magento 网站中,它没有在底部显示页码....在这个网站上,我有大约 6-7 个类别,每个类别都有大约 50 个产品

我对 Magento 管理面板所做的更改是:

在管理员 -> 目录 -> 目录 -> 前端

并且在 admin -> General -> Design-> Pagination 下

我只对这些进行了更改 此处未显示产品页面上的静止页码

任何想法为什么会发生?

编辑:

这是我的frontend\mgstheme\luxury\template\catalog/category/view.phtml 页面

<?php
$_helper = $this->helper('catalog/output');
$_category = $this->getCurrentCategory();
$_imgHtml = '';
if ($_imgUrl = $_category->getImageUrl()) {
    $_imgHtml = '<p class="category-image"><img class="img-responsive" src="' . $_imgUrl . '" alt="' . $this->escapeHtml($_category->getName()) . '" title="' . $this->escapeHtml($_category->getName()) . '" /></p>';
    $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
}

$settingDescPosition = 1;
$setting = Mage::getModel('mpanel/setting')->load($_category->getId());
if($setting){
    if($setting->getRatio()!=''){
        $settingDescPosition = $setting->getDescPosition();
    }
}

?>
<div class="page-title category-title">
    <?php if ($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?>
        <a href="<?php echo $this->getRssLink() ?>" class="link-rss"><?php echo $this->__('Subscribe to RSS Feed') ?></a>
    <?php endif; ?>
</div>

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php $helper = $this->helper('mpanel'); ?>
<div class="custom">
    <div class="container">
        <span><a href="127.0.0.1/demo"><i class="fa fa-home"></i></a> / <span><a href="#">Products</a></span> / <span><strong><?php echo $this->getCurrentCategory()->getName(); ?></strong></span></span>
    </div>
</div>
<?php if ($this->isContentMode()): ?>
    <?php echo $this->getCmsBlockHtml() ?>

<?php elseif ($this->isMixedMode()): ?>
    <?php echo $this->getCmsBlockHtml() ?>
    <div id="product-list-container">
        <?php echo $this->getProductListHtml() ?>
    </div>
<?php else: ?>
    <div id="product-list-container">
        <?php echo $this->getProductListHtml() ?>
    </div>
<?php endif; ?>

<?php if ($helper->acceptToUsePanel()): ?>
    <?php // description position below product list ?>
    <?php if($settingDescPosition==2): ?>
        <div class="builder-container inline-builder">
            <?php if ($_description = $this->getCurrentCategory()->getDescription()): ?>
                <div class="category-description std">
                    <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
                </div>
                <?php echo $helper->getEditCategoryDescription($_category->getId()) ?>
            <?php else: ?>
                <div class="category-description std">
                    <span class="placeholder">Add description for this category</span>
                </div>
                <?php echo $helper->getEditCategoryDescription($_category->getId()) ?>
            <?php endif; ?>
        </div>
    <?php endif ?>

<?php else: ?>
    <?php // description position below product list ?>
    <?php if($settingDescPosition==2): ?>
        <?php if ($_description = $this->getCurrentCategory()->getDescription()): ?>
            <div class="category-description std">
                <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
            </div>
        <?php endif; ?>
    <?php endif ?>
<?php endif; ?>

【问题讨论】:

    标签: magento magento-1.9


    【解决方案1】:

    解决了

    将此代码添加到view.phtml

    &lt;?php echo $this-&gt;getToolbarBlock()-&gt;setTemplate('catalog/product/list/bottom_toolbar.phtml')-&gt;toHtml(); ?&gt;

    【讨论】:

      【解决方案2】:

      检查catalog.xml 是否调用了xml 进行分页。 xml 应如下所示

      <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
       <block type="page/html_pager" name="product_list_toolbar_pager"/>
      </block>
      

      根据您的屏幕截图,您使用的是自定义主题,因此请重新检查所有 phtml 文件是否在与分页相关的文件夹中。

      如果您仍然面临同样的问题,请查看以下链接,这将对您有所帮助: https://support.webcto.eu/index.php/Knowledgebase/Article/View/43/8/paginating-not-shown-in-magento

      【讨论】:

      • 我没有在我的代码中找到任何分页代码...你能检查一下吗...我更新了我的代码
      • 仅供参考,它不是您在帖子中提到的正确文件:frontend\mgstheme\luxury\template\catalog/category/view.phtml 请检查以下位置和文件:- 布局:app /design/frontend/default//template/catalog/product/list/toolbar.phtml 块文件:app\code\core \Mage\Catalog\Block\Product\List\Toolbar.php
      • 使用参考“catalog_category_default”在目录页面中添加分页
      • app/design/frontend/default/ here 我的主题名称不可用。抱歉,我是 Magento 的新手
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多