I have been testing with the global value 'show_page_heading' set to on and I have run into an issue for which I cannot find a solution. We have the following structure
Parent Category
Child Cat1 - Child Cat2 - Child Cat 3
There aren't any products in the Parent Category, just in the child categories. We have created a category listing menu link to the Parent category, and under the products options we have set Sub elements filter to 'Group by Category'. We have created product listing menu links to each of the child categories.
If you click the link to the parent category the show page heading shows before the sub categories and then underneath we have the products in the grouped together, each with the category title.
If you clicked the menu link to chilld category originally there were two titles, the page heading and the category name. We solved this problem by modifying the product listing page from
<h2><?php echo $category['category']->category_name; ?></h2>
to
if (!$title)
{
echo '<h2>'.$category['category']->category_name .'</h2>';
}
And the the product listing works as wanted.
However if you start off in the parent category listing and click one of the contained links to a child category there is always the page heading plus the category name. I have tried with different values to hide the category name, however it is hidden in this view, it is also hidden in the parent category listing view.
I want when viewing the parent category, which has children categories, the child categories have titles, but when viewing the child as a category listing, in that they don't have any child categories themselves, you can hide the category name and use the page heading.
Is it possible when in a category listing view to find if the category viewed has any child categories or not?