I needed to add
after
Code:
$smarty->assign("subcategories",$subcategories);
$cat = $_oldcat;
in your products.php custom routine.
Here's why:
If the category has no products but has multiple subcategories, and if the last category of those subcategories has products, the page would display these products twice. Once within the sub category and once underneath the category.