0

我试图仅在第一页上显示类别描述。以下代码不起作用 - 知道如何修复它吗?

<div class="category-description std">
    <?php 
    if (strlen($_SERVER['QUERY_STRING']) = 0 || $_GET['p'] = '1') 
        {

        echo $_helper->categoryAttribute($_category, $_description, 'description'); 

        }

    ?>
</div>
4

2 回答 2

1

请试试这个 :

<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
<?php $currentPage = (int) Mage::App()->getRequest()->getParam('p'); 
if($currentPage <= 1):
?>
<div class="category-description std">
    <?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>
<?php endif; ?> 
<?php endif; ?>'
于 2013-07-31T07:13:34.530 回答
0

您可以使用产品列表工具栏了解您是否在第一页:

if ($this->isContentMode()
    || $this->getChild('product_list')->getToolbarBlock()->isFirstPage()) {
    // Display description (assuming that content mode is always first page)
}
于 2013-07-31T07:16:00.420 回答