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

Move Toolbar to Left block
 
knospe
Jr. Member
 
Total Posts:  11
Joined:  2012-02-14
Germany
 

Hello,

I am having problems moving Product List toolbar from content block to left block.
I would like to display only sort-by option, which is easily done by setting up a custom toolbar template file toolbar_custom.html. But I get an error by output.

So far I added this lines in layout/catalog.xml:

<catalog_category_default translate="label">
        <
label>Catalog Category (Non-Anchor)</label>
        <
reference name="left">
            <
block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml">
            <
block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar_custom.phtml"/>
            <
action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
        </
block>
        </
reference>
        <
reference name="content">
            <
block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <
block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml"/>
            </
block>
        </
reference>
    </
catalog_category_default>

---

and this in navigation/left.phtml:

<?php $magento_block Mage::getSingleton('core/layout'); ?>
<?php $toolbarHtml 
$magento_block->createBlock('catalog/product_list'); ?>
<?php $toolbarHtml
->setTemplate('catalog/product/list/toolbar_custom.phtml'); ?>
<?php 
echo $toolbarHtml ->toHTML(); ?>

---

This is my custom toolbar template - toolbar_custom.phtml:

<?php if($this->getCollection()->getSize()): ?>
<div class="toolbar">
    
<?php if( $this->isExpanded() ): ?>
        
<div class="sort-by">
            <
label><?php echo $this->__('Sort By'?></label>
            <
select onchange="setLocation(this.value)">
            
<?php var_dump($this->getName()); ?>
            <?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 $this->__($_order?>
                
</option>
            
<?php endforeach; ?>
            
</select>
        </
div>
    
<?php endif; ?>
</div>
<?php endif ?>

---

As I open the product listing page in browser I get this error message:
Fatal error: Call to a member function getSize() on a non-object in magento/app/design/frontend/my_theme/default/template/catalog/product/list/toolbar_custom.phtml on line 37

I am using Magento Community 1.6..

Any help would be very much appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Blackthorn87
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2011-06-27
 

Hey Guys,

BUMP!

I don’t suppose anyone managed to solve this problem. I am having the same issue.

Thank You.

 
Magento Community Magento Community
Magento Community
Magento Community
 
q23media
Member
 
Avatar
Total Posts:  72
Joined:  2009-04-29
 

I’m searching for this solution over several month in millions of google searches and thousends of forum posts...there is really no solution to move the toolbar to the left sidebar...i guess because its rendered by the list php file…
but there has to be a solution guys...come on, please help us...or please tell us if its not possible…

thank you so much
jakob

 
Magento Community Magento Community
Magento Community
Magento Community
 
jeff081
Jr. Member
 
Total Posts:  11
Joined:  2012-11-25
 

Hello everyone

I also implemented the same thing as you mentioned above but faced the same error…

Thanx in advance if anybody have answer for this

 
Magento Community Magento Community
Magento Community
Magento Community
 
q23media
Member
 
Avatar
Total Posts:  72
Joined:  2009-04-29
 

obviously there is no other solution than using css and position absolute...very dirty, but for many reasons (e.g. ajax loading improved navigation) i don’t think its possible to move the toolbar to the left.

 
Magento Community Magento Community
Magento Community
Magento Community
 
yangkinghoi
Jr. Member
 
Total Posts:  3
Joined:  2011-10-03
 

finally I did…

Image Attachments
快照70.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
Drumhead
Jr. Member
 
Total Posts:  1
Joined:  2013-08-02
 
yangkinghoi - 26 November 2013 06:51 PM

finally I did…

Could you also tell us how? wink

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