0

I have created a category in Magento with a custom layout as follows:

<reference name="product_list">
<action method="setTemplate"><name>catalog/product/custom.phtml</name></action>
</reference>

In this custom.phtml I have modified the $_productCollection in order to get a desired collection to show up, but there is no toolbar generated in order for the results to be sortable or have proper pagination.

Any suggestions on how I can generate the toolbar for the custom collection I just created?

1

You can add toolbar to your custom collection by adding this to your custom.phtml template

$toolbar = Mage::getBlockSingleton(‘catalog/product_list’)->getToolbarBlock();
$toolbar->setCollection($_productCollection);
$toolbar->setChild(‘product_list_toolbar_pager’);
echo $toolbar->toHtml();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.