I am used to using local.xml for my layout updates, however I cant seem to remove the toolbar from the product list block using either the remove or unsetChild methods.
Can anyone say if this is actually not possible or am i doing something wrong?
I have tried:
<action method="unsetChild">
<alias>toolbar</alias>
</action>
and
<action method="unsetChild">
<alias>product_list_toolbar</alias>
</action>
and also the <remove name="" />
methods too but nothing works.
Best Answer
And you won't be able to remove it without overriding something. Here is how the
getToolbarBlock()
method looks like:This means that if a block with a certain name (value returned by
getToolbarBlockName
) exists in the layout then that block will be returned. otherwise a new block is created with typecatalog/product_list_toolbar
and that is returned by the method.[EDIT] I just had a crazy idea. Why not change the toolbar block type? That way it won't be rendered as a toolbar. I haven't tried it but I think it's worth it.
Something like:
I mean adding a block with the same name but a different type. If it doesn't work please don't donwvote; it is just in idea :)