-
-
<?php
+/*
+ * - Only shows top-level categories
+ * - Unless a top-level category is selected, then it shows the subcats for that category
+ * - Currently selected category gets a > prefix. Also applied to parent category if current category is a subcategory
+ * - Going into a product still shows the selected subcategory (see: if is_product())
+ *
+ * FLAWS:
+ * - If a product has multiple categories assigned to it it may only recognise the last one
+ * (foreach $terms as $term --> $current_cat_id = $term->term_id)
+ * - There may be outlying situations where the default values (else) of id 0 and parent 0 are undesirable
+ */
+
if (is_shop()) {
$current_cat_id = 0;
$current_cat_parent = 0;
}
}
echo '</div>';
-
}
-
?>
<?php } ?>
<?php } ?>
\ No newline at end of file