Which function is responsible for displaying the total count of products in the filters in the layered navigation.
ie) I need to get the count (eg 50 ) in my custom filterable attributes as well.
This is how I have overridden filter.phtml in my code \Vendor\LayeredNavigation\view\frontend\layout\catalogsearch_result_index.xml
<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock class="Vendor\LayeredNavigation\Block\Navigation" before="-" name="catalogsearch.leftnav">
<action method="setTemplate">
<argument name="template" xsi:type="string">Vendor_LayeredNavigation::layer/view.phtml</argument>
</action>
</referenceBlock>
<referenceContainer name="content">
<block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalogsearch.navigation.renderer" as="renderer" template="layer/filter.phtml"/>
</referenceContainer>
</body>
di.xml
<preference for="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" type="Vendor\LayeredNavigation\Block\Navigation\FilterRenderer" />