From e354acfa02a7be028fd9ff4adadf3a2d4e6807ae Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Tue, 5 Dec 2017 14:01:34 -0500 Subject: [PATCH] Added documentation to the shop category display file --- parts/shop-cats-and-products.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/parts/shop-cats-and-products.php b/parts/shop-cats-and-products.php index bb3c93b..d8ee7e7 100644 --- a/parts/shop-cats-and-products.php +++ b/parts/shop-cats-and-products.php @@ -1,6 +1,16 @@ - - 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; @@ -98,9 +108,7 @@ } } echo ''; - } - ?> \ No newline at end of file -- 2.17.1