/**
* Gets the HTML associated with the category menu title
*
* @param CategoryInterface $category A category instance
* @param int $limit A limit for calculation (fixed to 500 by default)
*
* @return string
*/
protected function getCategoryTitle(CategoryInterface $category, $limit = 500)
{
$count = $this->categoryManager->getProductCount($category, $limit);
return sprintf("%s <span class=\"badge pull-right\">%d%s</span>", $category->getName(), $count, $count > $limit ? '+' : '');
}