Question

I have created Promotion product list in CMS page. I have call block in my cms page as a {{block type='catalog/product_list_promotion' template='catalog/product/list.phtml'}}. And also create on attribute promotion. Using this I can fetch all products, which have special price.

All products are list, but pagination is not showing there.

Could you help me for this situation ?

I have some screen shots for better understanding.

enter image description here

enter image description here

I have take reference from here : http://inchoo.net/ecommerce/magento/promotion-and-random/

Was it helpful?

Solution

You are supposed to define explicitly a pagination toolbar in the layout XML and "bind" it to the product listing template. Unfortunately, calling the block directly from the template (CMS page content in your case) has one huge disadvantage: there's no reference to such a block for the layout updates.

What I would do to achieve your goals is to remove following statement:

{{block type='catalog/product_list_promotion' template='catalog/product/list.phtml'}}

from the Content textaraea and move it to the layout updates instead.

Go to the Design tab in your CMS page and add following statement to the Layout Update XML textarea:

<reference name="content">
    <block type="catalog/product_list_promotion" name="product_promotion" template="catalog/product/list.phtml">
        <block type="catalog/product_list_toolbar" name="product_list_toolbar">
            <block type="page/html_pager" name="product_list_toolbar_pager"/>
        </block>
        <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
    </block>
</reference>

Just keep in mind that Content is a required field, so you cannot leave it empty. You can put in there <p>&nbsp;</p> or <div></div> or <!-- -->or whatever else giving no output on the frontend.

EDIT: Alternatively, in the Layout Update XML textarea you can define the toolbar only:

<block type="catalog/product_list_toolbar" name="product_list_toolbar">
    <block type="page/html_pager" name="product_list_toolbar_pager"/>
</block>

and append it to the product listing template directly in the Content textarea, by adding toolbar_block_name attribute:

{{block type='catalog/product_list_promotion' template='catalog/product/list.phtml' toolbar_block_name='product_list_toolbar'}}

Actually, the "alternative" method should be the basic one, but I wasn't sure of it and just checked it on some working Magento installation.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top