Now in the search bar products and categories are displayed. In the product and category header, I show the See All button that redirects to all related products and categories.

I want to show the related items count in the search with the see all button.

1 Answer 1


Try with get the product search criteria, $searchCriterias = $block->getSearchCriterias();

we need to loop through the left and right side on the searchCriterias as,

foreach ($searchCriterias[$side] as $criteria)
$searchCriterias = $block->getSearchCriterias();

  • In which template I will do this
    – Rana Zain
    Commented Dec 26, 2022 at 11:35
  • Please try to extend the module-catalog-search\view\frontend\templates\advanced\result.phtml in your custom theme Commented Dec 26, 2022 at 11:36
  • This is not working
    – Rana Zain
    Commented Dec 26, 2022 at 12:08
  • Can I share my template
    – Rana Zain
    Commented Dec 26, 2022 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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