WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WooCommerce] When on parent catagory show only sub-catagories (23 posts)

  1. DonGaspari
    Member
    Posted 2 years ago #

    This may not be plugin related but it could be. So I have a parent categoy [Products] and than a few sub-categories what bothers me is when I click on parent category [Producst] I get listed all products from all sub-categories. What I want is that parent category shows only links (preferably with images) to each sub-category and no posts (yet).

    I did find out that under WooCommerce -> Settings -> Catalog there are 2 check boxes which for some reason make no changes to my categories:
    - Show subcategories on category pages
    - When showing subcategories, hide products

    They describe exactly what I need but nothing happens.

    Help will be much appreciated!

  2. tonepro1
    Member
    Posted 1 year ago #

    I'm having the same problem. Did you figure it out?

  3. stevefafel
    Member
    Posted 1 year ago #

    Has anyone figured this out because it seems like the options to hide products for subcategories does not work. Am I missing something?

  4. nikoza
    Member
    Posted 1 year ago #

    Same problem here. I have checked the "When showing subcategories, hide products" in the woocommerce settings but I keep on having the products appearing instead of the subcategories.

    Had anybody managed to resolve that issue.
    The strange thing is that I have not even touched the template files neither I have copied any template files in my woocommerce folder in the theme.

    I believe that there is something goin on with this function
    woocommerce_product_subcategories(); in the archive-product.php but I don't know how can I make that work.

    Any help will be much appreciated.

    Cheers,
    Nick

  5. nikoza
    Member
    Posted 1 year ago #

    The solution of my problem was:

    I copied the archive-product.php into my template files and I editted the function woocommerce_product_subcategories();

    to be:
    woocommerce_product_subcategories(array('force_display' => true));

    Then I got the subcategories instead of the items.

    Hope that helps!

  6. manse100
    Member
    Posted 1 year ago #

    I am getting the same problem as above. I have 2 sites using woocommerce, one of which I haven't update to the latest version, so I suspect its that the causes the problem.

    @nikoza

    I've tried to follow you solution, but I'm slightly confused about what file you edited etc. I've been into the .archive-product.php file in the woocommerce directory but can't see any reference to the woocommerce_product_subcategories();

    Any help would be greatly appreciated as this is driving me mad !!! ;o(

    Thanks all

  7. nikoza
    Member
    Posted 1 year ago #

    This is exactly what I did:

    <?php woocommerce_product_subcategories(array('force_display' => true)); ?>

    This function is located in line 55 of the archive-product.php

    Good luck

  8. aurelien.kochalski
    Member
    Posted 1 year ago #

    I've got the exactly same problem.
    The "force_display" method works for me, it shows the sub categories now.
    But it doesn't hide the products, so the problem remain.

    I want to realize this kind of hierachy :
    - Home (no products)
    -- Category 'cat1' (shows only sub categories of 'cat1' = 'sub1' & 'sub2')
    --- Sub category 'sub1' (shows only products of 'sub1')
    --- Sub category 'sub2' (shows only products of 'sub2')

    Is it possible in any way?
    Thank you.

  9. Amavai
    Member
    Posted 1 year ago #

    Hi,

    Did you find the solution to hide products is the category has sub-categories?

    Many thanks!

  10. laciryl
    Member
    Posted 1 year ago #

    Anyone ever figure this problem out?

  11. jaspn
    Member
    Posted 1 year ago #

    I am also having this problem, and it looks like from the age of this post this has been ignored or overseen. Is there a way we can forward this thread to the WC team? Obviously something is not working as it should. Resorting to code hacks to enable intended functionality is not ideal.

  12. 20097784
    Member
    Posted 1 year ago #

    also having this problem. also not confident to change code in case i mess things up

  13. nickzee
    Member
    Posted 1 year ago #

    Anyone have success with this yet (beside editing the php)? Has anyone tried the default WP theme? I tried twenty twelve and twenty ten with no success.


    Both

    "Shop Page Display"
    "Default Category Display "

    are set to "show subcategories"

    I've tied using these shortcode in a page.

    [product_category category="parent-slug"]

    [product_category category="subcat-1-slug, subcat-2-slug, subcat-3-slug, subcat-4-slug"]

    [product_categories number="subcat-1-slug, subcat-2-slug, subcat-3-slug, subcat-4-slug,"]

    [product_categories number="subcat-1-number, subcat-2-number, subcat-3-number,subcat-4-number"]
    This one worked to show subcategories, but after the subs all the other categories displayed.

    [product_category category=subcat-1-number, subcat-2-number, subcat-3-number,subcat-4-number"]
    Blank - No results

    Anyone else using a shortcode on a page, instead of the archive page?

    For now I'm going to use, [product_categories number="subcat-1-number, subcat-2-number, ssubcat-3-number,subcat-4-number"] , and just deal with it. However, this is a flaw because if I add a new subcategories then I'll have to add that subcat number to the shortcode.

    There is a setting under Products >> Categories >> Display Type and the options are "Display, Products, Subcategories, Both"

    I've tried all different ways and still have not succeed. There is nothing in the docs about this setting (yet).

    I know woo is updating their docs now. And perhaps they will shed more light on this and their shortcodes.

    If you are watching,
    @Coen Jacobs
    @jameskoster
    @mikejolley
    @WooThemes

    Can you chime in? 13 responses and 8 months old.

    Thank you for a great product.

  14. jameskoster
    Member
    Posted 1 year ago #

  15. nickzee
    Member
    Posted 1 year ago #

    @jameskoster

    Both
    "Shop Page Display"
    "Default Category Display "

    are set to "show subcategories"

  16. jameskoster
    Member
    Posted 1 year ago #

    It's working fine for me?

    Are you running the latest version of WooCommerce? And which theme are you using?

  17. nickzee
    Member
    Posted 1 year ago #

    Version 2.0.3

    Themeforest:
    Bounce: Professional WordPress & BuddyPress Theme

    Says that its Woo Commerce ready.

    Thank you James

  18. nickzee
    Member
    Posted 1 year ago #

    Which shortcode is recommended to display the subcategories?

  19. jameskoster
    Member
    Posted 1 year ago #

    [product_categories] - http://docs.woothemes.com/document/woocommerce-shortcodes/

    You shouldn't be using a shortcode for this though. This setting will only affect shop archives, not shortcodes.

  20. nickzee
    Member
    Posted 1 year ago #

    I got ya.

    .com/product-category/parent-slug/
    .com/product-category/parent-slug/subcat-slug

    I like the shortcode option because a shortcode in a page provides way more options then an archive page.

    ie;
    Page title - "Archives Category Slug / Site Name
    No page editor

    I do like the sorting dropdown and thankfully WordPress SEO by Yoast has a SEO section in the category setup.

    Thank you for your time @jameskoster

  21. jameskoster
    Member
    Posted 1 year ago #

    It might not have the full page editor but you can still add a description and insert shortcodes etc.

    There are more product permalink options since WooCommerce 2.0 + WordPress 3.5 too :-)

  22. greenfuture
    Member
    Posted 1 year ago #

    Hello
    can any of you dear fellow woocommerce users try to sum up the solution how to display categories and sub / nested categories in the best possible way with easy navigation to the subcategories and products.

    they must develop a good plug in for categories and subcategories for quick navigation

    Thanks

  23. coroleu
    Member
    Posted 1 year ago #

    Hi, i need to show all subcategories from current page category... Any idea?

Topic Closed

This topic has been closed to new replies.

About this Topic