This is only applicable when you have multiple parent categories and the whole menu is always expanded.
Issue: You have two parent categories with many sub-categories, you wish to have them always expanded in the menu, however the parent categories from the second and lower have no upper margin/padding and touch up against the last subcategory.
Fix: Place a <p> with line height above ONLY the parent categories in the loop.
bm_categories.php v2.3.1
Modified code:
function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;
for ($i=0; $i<$tree[$counter]['level']; $i++) {
$categories_string .= "<p class='small'>";
}
if (tep_has_category_subcategories($counter)) {
$categories_string .= '';
}
if ($tree[$counter]['parent'] == 0) {
$categories_string .= '<p style="line-height:10p;"></p><a href="';
$cPath_new = 'cPath=' . $counter;
} else {
$categories_string .= ' <a href="';
$cPath_new = 'cPath=' . $tree[$counter]['path'];
}
The above is my modified code, however you can easily modify the original part that looks like the below:Original code:
function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;
for ($i=0; $i<$tree[$counter]['level']; $i++) {
$categories_string .= " ";
}
$categories_string .= '<a href="';
if ($tree[$counter]['parent'] == 0) {
$cPath_new = 'cPath=' . $counter;
} else {
$cPath_new = 'cPath=' . $tree[$counter]['path'];
}
Which will only modify your main categories, in my above code i have placed a <p></p> above each parent category, as if you have the categories expanded that second and below gets squished up into the above category.
There is a few ways to do this, although i hope this helps someone and isn't too confusing. I apologise for any sloppy coding or poor logic. Any questions welcome.









