开发者

Magento: Catalog Page 1 different from other pages

开发者 https://www.devze.com 2023-01-07 00:05 出处:网络
I want to setup the category catalog pages in Magento such that the first page contains the category image and the first three products in that category.Then the following pages con开发者_StackOverflo

I want to setup the category catalog pages in Magento such that the first page contains the category image and the first three products in that category. Then the following pages con开发者_StackOverflow中文版tain six products per page without the category image.

I can't figure out how this can be done.


Unfortunately I don't think you can do this without a lot of work. You'll need to rewrite the logic of the pagination, change the page size depending on which page it is, & offset the returned collection.

However you can easily only have the category image displayed on the first page.

This line returns the current page number:

Mage::getBlockSingleton('page/html_pager')->getCurrentPage();

So in template/catalog/category/view.phtml you can just do a conditional around the category image display, find the section:

<?php if($_imgUrl): ?>
    <?php echo $_imgHtml ?>
<?php endif; ?>

and replace it with:

<?php if($_imgUrl): ?>
    <?php if(Mage::getBlockSingleton('page/html_pager')->getCurrentPage()==1):?>
        <?php echo $_imgHtml ?>
    <?php endif; ?>
<?php endif; ?>
0

精彩评论

暂无评论...
验证码 换一张
取 消