Trying to work out how you would go about checking if a Woocommerce category is the parent category.
I have a category and a sub category and in my Woocommerce template, have 2 separate layout HTML. 1 for the parent category and 1 for the sub category.
I'm currently using this:
if ( is_product_category( 'main-category' ) ) { ?>
But would be easier if it could check without manually inputting all parent categories.
And also, is there a way to link to the main parent category page from the sub category or sub categories product page?