Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Pagination problem
 
Qvist
Jr. Member
 
Total Posts:  8
Joined:  2010-03-22
 

Hi Everyone

I’ve added this block on my “home” page to list all my shop’s product on the front pages

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}}

problem is that the block doesn’t show the pager in the toolbar, so there is no way of navigating though the products.
See “Missing_pager.png”

Any one who has an Idea of why the pager is gone and how to get it to show?

the pager works if I go to a category page like ..../index.php/parts.html
See “Pager_working.png”

Thanks up front!

Image Attachments
missing_pager.pngpager_working.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
henk001
Jr. Member
 
Total Posts:  12
Joined:  2010-02-26
 

Hi,

I’m experiencing the same problem, no pagination on my home page, have you found a solution for this problem?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jguiss
Member
 
Avatar
Total Posts:  75
Joined:  2007-11-30
France / Avignon
 

Same for me…

 
Magento Community Magento Community
Magento Community
Magento Community
 
XedinUnknown
Jr. Member
 
Total Posts:  9
Joined:  2009-07-06
 

Hi All!

I have encountered the same problem. I haven’t solved it yet, but I’ve found the cause.
Attention, Team Members!!!

---------------------------------------

To create the pagination block (Mage_Page_Block_Html_Pager) you need to specify it’s name in the XML (catalogsearch.xml). This is how it is done in catalog.xml:

<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
However, it this case Mage_Catalog_Block_Product_List will attempt to create a block of type Mage_Block_Product_List_Toolbar (correct me if I’m wrong), which is invalid and does not exist, and give it the result of microtime() as a name. You can counter this by altering the XML parameter, like so:
<action method="setToolbarBlockName"><name>catalog/product_list_toolbar</name></action>
,
which is default by the way, so you can even leave this action out. However, after creating this block of type catalog/product_list_toolbar (the name would be something like “1275398519” or “0.46038300"), it will try to get the block by name, giving it catalog/product_list_toolbar (which is not it’s name), and returning boolean false (Mage_Catalog_Block_Product_List, line 170). In turn, this is received by Mage_Catalog_Block_Product_List_Toolbar at line 810, and an empty string is returned, thus displaying nothing where the pagination should be.

--------------------------------------

This looks easily solvable, but I’m not sure which solution is the best. I will let you know when I’m done.

 
Magento Community Magento Community
Magento Community
Magento Community
 
XedinUnknown
Jr. Member
 
Total Posts:  9
Joined:  2009-07-06
 

Sorry, seems like I was wrong. This is my solution:

<catalogsearch_advanced_result translate="label">
        <
label>Advanced Search Result</label>
        <
update handle="page_two_columns_right" />
        <!-- 
Mage_Catalogsearch -->
        <
reference name="root">
            <
action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </
reference>
        <
reference name="content">
            <
block type="catalogsearch/advanced_result" name="catalogsearch_advanced_result" template="catalogsearch/advanced/result.phtml">
                <
block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
                    <
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>
                    <
action method="addColumnCountLayoutDepend"><layout>empty</layout><count>3</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>3</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>3</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>3</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                    <
action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                </
block>
                <
action method="setListOrders"/>
                <
action method="setListModes"/>
                <
action method="setListCollection"/>
            </
block>
        </
reference>
    </
catalogsearch_advanced_result>
 
Magento Community Magento Community
Magento Community
Magento Community
 
zahid hussain
Jr. Member
 
Total Posts:  1
Joined:  2010-06-01
 

Hi All!!
I have set a page with all All product with cutomization, now my qustion is .
1. who i will set all the product in cms page.?
2. in my all product pagination is not working, i set all product, but pagination is not working, my code is bleow.
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php
/**
* Product list template
*
* @see Mage_Catalog_Block_Product_List
*/
?>
<?php $_productCollection=$this->getLoadedProductCollection() ?>

<div class="category-products">
<?php //echo $this->getToolbarHtml() ?>
<?php // List mode ?>
<?php if($this->getMode()!='grid'): ?>
<?php $_iterator = 0; ?>
<ol class="products-list" id="products-list">
<?php foreach ($_productCollection as $_product): ?>
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
<?php // Product Image ?>
<a href="<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>” class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>” width="135" height="135" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>” /></a>
<?php // Product description ?>
<div class="product-shop">
<div class="f-fix">
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName())?></a></h2>
<?php if($_product->getRatingSummary()): ?>
<?php echo $this->getReviewsSummaryHtml($_product) ?>
<?php endif; ?>
<?php echo $this->getPriceHtml($_product, true) ?>
<?php if($_product->isSaleable()): ?>
<p><button style="border:none" type="button" title="<?php echo $this->__('Add to Cart') ?>” class="button btn-cart” onclick="setLocation(’<?php echo $this->getAddToCartUrl($_product) ?>’)"><img src="<?php echo $this->getSkinUrl("images/button_add_to_cart.gif");?>" /></button></p>
<?php else: ?>
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>
<div class="desc std">
<?php echo nl2br($this->htmlEscape($_product->getShortDescription())) ?>
<a href="<?php echo $_product->getProductUrl() ?>” title="<?php echo $this->htmlEscape($_product->getName()) ?>” class="link-more"><?php echo $this->__('Learn More') ?></a>
</div>
<ul class="add-to-links">
<?php if ($this->helper('wishlist')->isAllow()) : ?>
<li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>” class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
<?php endif; ?>
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>” class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
<?php endif; ?>
</ul>
</div>
</div>
</li>
<?php endforeach; ?>
</ol>
<script type="text/javascript">decorateList(’products-list’, ‘none-recursive’)</script>

<?php else: ?>

<?php // Grid Mode
$count = 0; ?>
<?php $product = Mage::getModel('catalog/product');
$_productCollection = $product->getCollection()->addAttributeToSelect('*');
$_collectionSize = $_productCollection->count() ?>
<?php $_columnCount = $this->getColumnCount(); ?>

<h2>Products</h2>

<table border="0" align="left" cellpadding="0" cellspacing="0" width="100%">
<?php foreach ($_productCollection as $_product): ?>
<?php if ( $count == 4 ){ $count=0;?>
<tr >
<td valign="top" align="left" ></div></td>
</tr>

<?php echo '<tr>';} ?>

<td width="150" align="left" valign="top" style="padding:5px;"><a href="<?php echo $_product->getProductUrl() ?>"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>” title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>” alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>” width="150" height="150" border="0" class="img_border1" /></a>
<span class="Text_4"><?php echo $_product->getShortDescription()?></span><br />
<span class="Text_7"><?php echo $this->getPriceHtml($_product, true) ?><br />
<?php if($_product->isSaleable()): ?>
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>” class="button btn-cart” onclick="setLocation(’<?php echo $this->getAddToCartUrl($_product) ?>’)"><img src="<?php echo $this->getSkinUrl("images/button_add_to_cart.gif");?>" /></button></p>
</td>
<?php else: ?>
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>

<?php endif; ?>

<td width="26" align="left" valign="top">

</td>


<?php if ( $count == 4 ) { echo '</tr>';
$count =0;
}else{ $count++;}?>

<?php endforeach ?>
<?php endif; ?>
</table>
<div class="toolbar-bottom">
<?php echo $this->getToolbarHtml() ;
?>
</div>
</div>

The above is a cms page i call it by cms page in admin with name product. and in the content like a block .

 
Magento Community Magento Community
Magento Community
Magento Community
 
telawat
Jr. Member
 
Total Posts:  7
Joined:  2010-03-30
 

Hello XedinUnknown

I haveing the same issue with the pageing in advance search option.......i have tried your code but nothing change at all… ...i badly need your help....i got 2days left to launch my website....i m stuck in here.....please if anybody has any solution plese post it as soon as possible

 
Magento Community Magento Community
Magento Community
Magento Community
 
Emanuel Op
Jr. Member
 
Total Posts:  27
Joined:  2010-02-18
 

This is because you have a custom theme that is not 1.4 valid so you should look in .../base/default/layout/catalogsearch.xml for the changes

the code block should be something like:

<block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
                    <
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>
                    <
action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                    <
action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                </
block>

Just like XedinUnknown said but you have to replace it in 2 places in that file under <catalogsearch_result_index translate="label"> and under <catalogsearch_advanced_result translate="label">

 
Magento Community Magento Community
Magento Community
Magento Community
 
pinoguin
Member
 
Avatar
Total Posts:  68
Joined:  2008-10-17
Philippines
 

This solution helped me:

http://www.noamdesign.com/blog/magento-include-toolbar-and-pagination-when-listing-products/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top