Wednesday, March 16, 2016

How to get Product item count in layered navigation on advanced search result page?

Leave a Comment

Actually i have display product attributes item count on product list page but when i call

<block type="catalog/layer_view" name="catalog.leftnav" template="catalog/layer/view.phtml">

XML block in advanced search result page in catalogsearch.xml i got wrong item count on left side. Can anyone please suggest me how to get proper count of attributes?

Thanks in advanced.

1 Answers

Answers 1

I think you can load category model using categoryId and then call getProductCount function like this:

$categoryData = Mage::getModel('catelog/category')->load($categoryId)->getProductCount();      echo $categoryData; 

This shall print your product count in this particular category. You can use block or your template to run your code, or in run-time you may also use your controller using an AJAX call.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment