How to hide subcategory from ( Sidebar filter ) in Shop Page

This topic has 3 replies, 3 voices, and was last updated 3 minutes ago ago by Andrew Mitchell

  • Avatar: woomart
    woomart
    Participant
    October 31, 2024 at 01:56

    hello,
    I have a lot of subcategories in my shop, I want hide subcategories from the Sidebar filter

    can you help please?

    yoomart.co.uk

    Content is visible for topic creator and
    support staff only.
    Files is visible for topic creator and
    support staff only.
    2 Answers
    Avatar: Justin
    Luca Rossi
    Support staff
    October 31, 2024 at 06:14

    Hi @woomart,

    There is no hooks to change this so we’ve edited this file: /wp-content/plugins/et-core-plugin/app/models/widgets/categories-filter.php around 124-129 lines.

    – From:

    
    		$categories = get_terms(array(
    			'taxonomy' => 'product_cat',
    			'hide_empty'       => $hide_empty,
    			'operator'         => 'IN',
    			'include_children' => false,
    		));
    

    – To:

    
    		$categories = get_terms(array(
    			'taxonomy' => 'product_cat',
    			'hide_empty'       => $hide_empty,
    			'operator'         => 'IN',
    			'include_children' => false,
    			'parent' => 0,
    		));
    

    Now the parent categories will show only. Could you please double check again?

    Thank you!

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    October 31, 2024 at 06:18

    Dear woomart,

    We hope you’re reveling in the experience our theme brings! Your enthusiasm is what fuels our passion. Would you be so kind as to channel that energy into a 5-star rating on ThemeForest? Your feedback is the spark that lights our way!

    Click here to spread the love: https://themeforest.net/downloads

    Thank you for being an integral part of our journey!

    Best Regards,
    The 8Theme Team

  • Viewing 3 results - 1 through 3 (of 3 total)

The issue related to '‘How to hide subcategory from ( Sidebar filter ) in Shop Page’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.