Magento Forum

   
Page 1 of 3
1.4.0 layouts update, pagination issue & new toolbar.phtml
 
Tomakun
Sr. Member
 
Total Posts:  77
Joined:  2008-10-21
 

In layout of any custom theme the usage of catalog/product_list_toolbar block should be changed to page/html_pager:
1) Replace the catalog/product/list/toolbar.phtml of your theme by the new one
2) Update catalog.xml layout: <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"> should be replaced into <block type="page/html_pager" name="product_list_toolbar_pager"/>

“Replace the catalog/product/list/toolbar.phtml of your theme by the new one"… “the new one” ?
Well that was very unclear. Mind giving us a link or specific location for the file?
I noticed a new app/design/base folder. Should we use the template/layout files in this folder?

Is there anything else that need to be changed on custom themes to match 1.4 requirements?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tomakun
Sr. Member
 
Total Posts:  77
Joined:  2008-10-21
 

Quoting replies from Magento Tech, for reference:

For now it is a known issue with catalog pagination block: if an old custom theme overrides it, then it will have compatibility issue. All other templates should be reviewed for functionality changes. Again I recommend to start from scratch as the easiest way: because the new templates without styles work just like a “blank” theme, already optimized for customization via clean CSS.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Anton Makarenko
Magento Team
 
Avatar
Total Posts:  184
Joined:  2008-05-13
Los Angeles, CA
 

Take a look at this one: http://www.noamdesign.com/Web-Design-Blog/upgrading-to-magento-1-4/

 
Magento Community Magento Community
Magento Community
Magento Community
 
EKoster
Jr. Member
 
Total Posts:  9
Joined:  2010-01-30
 

Hi, just jumping in for I had this pagiation issue too.

I made several adjustments reading this thread and the link listed in it.

1. replaced my toolbar.phtml located in app/design/frontend/default/THEME/template/catalog/product/list with the one in app/design/frontend/base/default/template/catalog/product/list

2. In the catalog.xml add the given line (<block type="page/html_pager" name="product_list_toolbar_pager"/>) in the category layered navigation layout section bellow the line ‘<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">’

3. Replaced the pager.phtml located in app/desin/frontend/default/THEME/template/page/html with the one in app/design/frontend/base/default/template/page/html

Now I do need to fiddle with the layout, but thats nothing compared to searching for this solution.

Hope it helps you too (and others).

 
Magento Community Magento Community
Magento Community
Magento Community
 
DCAlmeida
Sr. Member
 
Avatar
Total Posts:  164
Joined:  2008-12-28
PRT
 

Yes both explanations help a lot but you forget to explain how to solve toolbar problem at results catalogsearch page.

 
Magento Community Magento Community
Magento Community
Magento Community
 
EKoster
Jr. Member
 
Total Posts:  9
Joined:  2010-01-30
 

I forgot that one. I’m still figure it out but it’s lower priority then other things (I’m setting up to go live).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tomakun
Sr. Member
 
Total Posts:  77
Joined:  2008-10-21
 
Anton Makarenko - 22 February 2010 12:56 AM

Take a look at this one: http://www.noamdesign.com/Web-Design-Blog/upgrading-to-magento-1-4/

Thank for this Anton, and EKoster for your guidelines. However I noticed a problem after reading this post.  At the end of his article, Mike explains about the toolbar.phtml and the catalog.xml update. He says :

open catalog.xml located under app/design/frontend/default/yourthemename/layout/ and find this line:
<block type=”catalog/product_list_toolbar” name=”product_list_toolbar” template=”catalog/product/list/toolbar.phtml”>
And underneath insert this code:
<block type=”page/html_pager” name=”product_list_toolbar_pager”/>

He says underneath insert this code while on the release notes I can read “should be replaced”:

Update catalog.xml layout: <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"> should be replaced into <block type="page/html_pager" name="product_list_toolbar_pager"/>

Now this is very different. What’s the correct way to do it then?

 
Magento Community Magento Community
Magento Community
Magento Community
 
finderbee
Jr. Member
 
Total Posts:  8
Joined:  2008-04-14
 

Most likely you would need to put it underneath. This Product_List_Toolbar_Pager block (app/design/frontend/PACKAGE/THEME/Catalog/Product/List/Toolbar/Pager.phtml) provides pagination for a long product list. Say if a selected category has 100 products, the toolbar pager block will give you the nav elements needed to move through the pages of products. And so, if you left it out, your category would likely display “1 to 15 of 100 items” without the nav elements ( arrows and page numbers) to move to the next lot.

 
Magento Community Magento Community
Magento Community
Magento Community
 
DCAlmeida
Sr. Member
 
Avatar
Total Posts:  164
Joined:  2008-12-28
PRT
 
Tomakun - 22 February 2010 04:21 PM

open catalog.xml located under app/design/frontend/default/yourthemename/layout/ and find this line:
<block type=”catalog/product_list_toolbar” name=”product_list_toolbar” template=”catalog/product/list/toolbar.phtml”>
And underneath insert this code:
<block type=”page/html_pager” name=”product_list_toolbar_pager”/>

He says underneath insert this code while on the release notes I can read “should be replaced”:

Update catalog.xml layout: <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"> should be replaced into <block type="page/html_pager" name="product_list_toolbar_pager"/>

Now this is very different. What’s the correct way to do it then?

And underneath, if you replace you will get a error! Yes, I also got it so, I advice you to add under…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tomakun
Sr. Member
 
Total Posts:  77
Joined:  2008-10-21
 

Thanks you all guys for your replies. Much appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
misterMan
Member
 
Total Posts:  57
Joined:  2008-07-15
 

Okay, so I did all the above items and my categories work, BUT I now have the unsightly mess of pagination as seen in my screen shot.

Does anyone have a fix for this? I have been trying to merge the two toolbar files but my eyes( and brain) are growing very fuzzy as I’ve been dealing with this for some time. Can anyone help? A simple merged toolbar file to download would be the best.

Thanks a ton!

PS This is the default theme. No customization.
PSS I tried replacing the pager.phtml and still the same look. I am now lost…

Help!

Here is the new toolbar.phtml…

<?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 toolbar
 *
 * @see Mage_Catalog_Block_Product_List_Toolbar
 */
?>
<?php 
if($this->getCollection()->getSize()): ?>
<div class="toolbar">
    <
div class="pager">
        <
class="amount">
            
<?php if($this->getLastPageNum()>1): ?>
                <?php 
echo $this->__('Items %s to %s of %s total'$this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
            <?php 
else: ?>
                
<strong><?php echo $this->__('%s Item(s)'$this->getTotalNum()) ?></strong>
            
<?php endif; ?>
        
</p>

        <
div class="limiter">
            <
label><?php echo $this->__('Show'?></label>
            <
select onchange="setLocation(this.value)">
            
<?php foreach ($this->getAvailableLimit() as  $_key=>$_limit): ?>
                
<option value="<?php echo $this->getLimitUrl($_key) ?>"<?php if($this->isLimitCurrent($_key)): ?> selected="selected"<?php endif ?>>
                    
<?php echo $_limit ?>
                
</option>
            
<?php endforeach; ?>
            
</select<?php echo $this->__('per page'?>
        
</div>

        
<?php echo $this->getPagerHtml() ?>

    
</div>

    
<?php if( $this->isExpanded() ): ?>
    
<div class="sorter">
        
<?php if( $this->isEnabledViewSwitcher() ): ?>
        
<class="view-mode">
            
<?php $_modes $this->getModes(); ?>
            <?php 
if($_modes && count($_modes)>1): ?>
            
<label><?php echo $this->__('View as'?>:</label>
            
<?php foreach ($this->getModes() as $_code=>$_label): ?>
                <?php 
if($this->isModeActive($_code)): ?>
                    
<strong title="<?php echo $_label ?>" class="<?php echo strtolower($_code); ?>"><?php echo $_label ?></strong>&nbsp;
                
<?php else: ?>
                    
<a href="<?php echo $this->getModeUrl($_code) ?>" title="<?php echo $_label ?>" class="<?php echo strtolower($_code); ?>"><?php echo $_label ?></a>&nbsp;
                
<?php endif; ?>
            <?php 
endforeach; ?>
            <?php 
endif; ?>
        
</p>
        
<?php endif; ?>
    
        
<div class="sort-by">
            <
label><?php echo $this->__('Sort by'?></label>
            <
select onchange="setLocation(this.value)">
            
<?php foreach($this->getAvailableOrders() as $_key=>$_order): ?>
                
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
                    
<?php echo $_order ?>
                
</option>
            
<?php endforeach; ?>
            
</select>
            
<?php if($this->getCurrentDirection() == 'desc'): ?>
                
<a href="<?php echo $this->getOrderUrl(null, 'asc') ?>" title="<?php echo $this->__('Set Ascending Direction') ?>"><img src="<?php echo $this->getSkinUrl('images/i_desc_arrow.gif') ?>" alt="<?php echo $this->__('Set Ascending Direction') ?>" class="v-middle" /></a>
            
<?php else: ?>
                
<a href="<?php echo $this->getOrderUrl(null, 'desc') ?>" title="<?php echo $this->__('Set Descending Direction') ?>"><img src="<?php echo $this->getSkinUrl('images/i_asc_arrow.gif') ?>" alt="<?php echo $this->__('Set Descending Direction') ?>" class="v-middle" /></a>
            
<?php endif; ?>
        
</div>
    </
div>
    
<?php endif; ?>
</div>
<?php endif ?>

And here is the old…

<?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_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 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 toolbar
 *
 * @see Mage_Catalog_Block_Product_List_Toolbar
 */
?>
<?php 
if($this->getCollection()->getSize()): ?>
    
<table class="pager" cellspacing="0">
        <
tr>
            <
td>
            
<?php if($this->getLastPageNum()>1): ?>
                <?php 
echo $this->__('Items %s to %s of %s total'$this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?>
            <?php 
else: ?>
                
<strong><?php echo $this->__('%s Item(s)'$this->getTotalNum()) ?></strong>
            
<?php endif; ?>
            
</td>
            
<?php if($this->getLastPageNum()>1): ?>
            
<td class="pages">
                <
strong><?php echo $this->__('Page:'?></strong>
                <
ol>
                
<?php if (!$this->isFirstPage()): ?>
                    
<li><a href="<?php echo $this->getPreviousPageUrl() ?>"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_left.gif') ?>" alt="<?php echo $this->__('Previous') ?>" /></a></li>
                
<?php endif ?>
                <?php 
foreach ($this->getPages() as $_page): ?>
                    <?php 
if ($this->isPageCurrent($_page)): ?>
                        
<li><span class="on"><?php echo $_page ?></span></li>
                    
<?php else: ?>
                        
<li><a href="<?php echo $this->getPageUrl($_page) ?>"><?php echo $_page ?></a></li>
                    
<?php endif ?>
                <?php 
endforeach;; ?>
                <?php 
if (!$this->isLastPage()): ?>
                    
<li><a href="<?php echo $this->getNextPageUrl() ?>"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_right.gif') ?>" alt="<?php echo $this->__('Next') ?>" /></a></li>
                
<?php endif ?>
                
</ol>
            </
td>
            
<?php endif; ?>
            
<td class="a-right">
                
<?php echo $this->__('Show'?> <select onchange="setLocation(this.value)">
                
<?php foreach ($this->getAvailableLimit() as  $_key=>$_limit): ?>
                    
<option value="<?php echo $this->getLimitUrl($_key) ?>"<?php if($this->isLimitCurrent($_key)): ?> selected="selected"<?php endif ?>>
                        
<?php echo $_limit ?>
                    
</option>
                
<?php endforeach; ?>
                
</select<?php echo $this->__('per page'?>
            
</td>
        </
tr>
    </
table>
    
<?php if( $this->isExpanded() ): ?>
    
<table class="view-by" cellspacing="0">
        <
tr>
            
<?php if( $this->isEnabledViewSwitcher() ): ?>
            
<td>
                
<?php $_modes $this->getModes(); ?>
                <?php 
if($_modes && count($_modes)>1): ?>
                <?php 
echo $this->__('View as'?>:
                
<?php foreach ($this->getModes() as $_code=>$_label): ?>
                    <?php 
if($this->isModeActive($_code)): ?>
                        
<strong><?php echo $_label ?></strong>&nbsp;
                    
<?php else: ?>
                        
<a href="<?php echo $this->getModeUrl($_code) ?>"><?php echo $_label ?></a>&nbsp;
                    
<?php endif; ?>
                <?php 
endforeach; ?>
                <?php 
endif; ?>
            
</td>
            
<?php endif; ?>
            
<td class="sort-by">
                
<?php echo $this->__('Sort by'?> <select onchange="setLocation(this.value)">
                
<?php foreach($this->getAvailableOrders() as $_key=>$_order): ?>
                    
<option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
                        
<?php echo $_order ?>
                    
</option>
                
<?php endforeach; ?>
                
</select>
                
<?php if($this->getCurrentDirection() == 'desc'): ?>
                    
<a href="<?php echo $this->getOrderUrl(null, 'asc') ?>"><img src="<?php echo $this->getSkinUrl('images/sort_desc_arrow.gif') ?>" alt="<?php echo $this->__('Set Ascending Direction') ?>" class="v-middle" /></a>
                
<?php else: ?>
                    
<a href="<?php echo $this->getOrderUrl(null, 'desc') ?>"><img src="<?php echo $this->getSkinUrl('images/sort_asc_arrow.gif') ?>" alt="<?php echo $this->__('Set Descending Direction') ?>" class="v-middle" /></a>
                
<?php endif; ?>
            
</td>
        </
tr>
    </
table>
    
<?php endif; ?>
<?php 
endif ?>

Am I in the right page or should it be the pager.phtml that I need to update?

Thanks again.

Image Attachments
layouterror.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
Tomakun
Sr. Member
 
Total Posts:  77
Joined:  2008-10-21
 
misterMan - 22 February 2010 08:12 PM

Okay, so I did all the above items and my categories work, BUT I now have the unsightly mess of pagination as seen in my screen shot.

Does anyone have a fix for this? I have been trying to merge the two toolbar files but my eyes( and brain) are growing very fuzzy as I’ve been dealing with this for some time. Can anyone help? A simple merged toolbar file to download would be the best.

It looks like a pure CSS issue here. I don’t think you want to merge anything. If you compare the old toolbar.phtml with the new one, you’ll see that things like containers and classes have changed. Not to mention your old file is starting with a table.

I’ve learned in the forum that it is best to develop themes specifically for 1.4 and start from scratch. Doing so would solve most of the errors encountered with 1.3 themes running under 1.4. I would advise not to update if you don’t have a 1.4 compatible theme ready. For people who already upgraded and are experiencing errors with old themes, best is to find temporary fixes and start over a new theme on the side.

 
Magento Community Magento Community
Magento Community
Magento Community
 
misterMan
Member
 
Total Posts:  57
Joined:  2008-07-15
 

Thanks for the quick answer!

I am using the default 1.3 theme. I’d be happy to up grade to the default 1.4 theme. Wasn’t it downloaded with 1.4?? Not sure what to do here. Is it already there or should I grab it from the .zip 1.4 file?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tomakun
Sr. Member
 
Total Posts:  77
Joined:  2008-10-21
 

You can grab it on the zip file I believe.

 
Magento Community Magento Community
Magento Community
Magento Community
 
misterMan
Member
 
Total Posts:  57
Joined:  2008-07-15
 

Okay, so I uploaded the entire default dir with the iPhone, Modern, default and blank themes. So far so good, all is working. I now need to tweak my “new” theme again to get it to my liking.

Thanks again for the quick reply.

 
Magento Community Magento Community
Magento Community
Magento Community
 
misterMan
Member
 
Total Posts:  57
Joined:  2008-07-15
 

Yup, it took a HUGE crap. Reinstalling the default themes, etc worked, but none of my modules worked as they were installed in the old dir. The Contact Us page was not working in the new theme either. So I tried to reinstall everything, now it’s just a cluster f***.

Good job Varien! I love that the “Team” member pointed us to an outside page for the fix to this dismal failure of a ... Well, at least I’m not live yet with this shop. I’ll just reinstall it all AGAIN!!!!!!!. Hmmm Prestashop aint looking so bad atm. Or maybe OpenCart. Hell, even osCommerce was more stable than this.

Ya, I’ve been working with Magento since early 2008. Always the same pile of doo with updates. Never ever EVER update a production site. But of course they say that in their “docs” HA!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 3