Tried a few different approaches to this but still not sure of the best option for something which should be relatively simple. I want to output the current product result count, instead of within the toolbar, in the layered navigation (left block).

I realise that I need to use an instance of catalog/product_list_toolbar to be able to access $this->getTotalNum(), but creating a new block with the same block class doesn't work. I've tried the below but it seems to result in a slower page load and count results inconsistent with what's in the toolbar:

<?php $customBlock = $this->getLayout()->getBlock('product_list'); ?>
    <?php echo $customBlock->getLoadedProductCollection()->count(); ?>

Thanks for any pointers.

Your Answer

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

Browse other questions tagged or ask your own question.