2013-07-31 80 views
0

我試圖在第一頁上僅顯示類別描述。下面的代碼不工作 - 任何想法如何解決它?如何僅在Magento的第一頁上顯示類別描述

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

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

     } 

    ?> 
</div> 

回答

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; ?>' 
0

您可以使用產品列表工具欄要知道,如果你在第一頁上:

if ($this->isContentMode() 
    || $this->getChild('product_list')->getToolbarBlock()->isFirstPage()) { 
    // Display description (assuming that content mode is always first page) 
} 
相關問題