• Ritter Knight

    (@thundermarketing)


    In the WooCommerce settings, if you uncheck “When showing subcategories, hide products” it shows all products underneath that category, even under any of the current sub-level categories.

    I need a variant of that—is there a way to only show products of the *current category* but not any of the subcategories?

    For example, if I’m currently browsing Subcategory A, right now it shows:

    Main Category
    * Subcategory A
    * * Subcategory B
    * * Subcategory C
    * Products of Subcategory A
    * Products of Subcategory B
    * Products of Subcategory C

    We’d like it to show:

    Main Category
    * Subcategory A
    * * Subcategory B
    * * Subcategory C
    * Products of Subcategory A

    Especially when you’re on Main Category, it shows all products underneath that category as well as any subcategories. I just need subcategories.

    I don’t have any products underneath the Main Category so it shouldn’t display any products.

    I made a copy of archive-product.php and woocommerce_product_subcategories() so I could experiment but at a loss as to what to change the wp_query to only query products in the current category (but not any of the children).

    Thanks,

    Dave

    https://www.ads-software.com/extend/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • I have the same inquiry. I think its really strange that by default it displays all of them on the parent categories especially on the homepage.

    Someone from woocommerce is looking into this right now, I will update this if I get a solution.

    thanks,

    King

Viewing 1 replies (of 1 total)
  • The topic ‘Only show subcategories and products of current category?’ is closed to new replies.