WordPress.org

Ready to get started?Download WordPress

Forums

Remove the Product Count on Woocommerce Categories (43 posts)

  1. drakedanner
    Member
    Posted 1 year ago #

    Hello,

    I'm using woocommerce on an Elegant Theme and naturally I'm running into problems as the themes are not optimized to run woocommerce. One annoying thing I'd really like to fix is this:

    <img src="http://i1063.photobucket.com/albums/t502/drakedanner/ScreenShot2012-08-06at31802PM.png" border="0" alt="Photobucket">

    See how the product count is highlighted in yellow? I would like to remove the highlight and the product count.

    Thank You,

    Drake

  2. drakedanner
    Member
    Posted 1 year ago #

    Sorry, can't seem to embed the image. Please visit this link http://i1063.photobucket.com/albums/t502/drakedanner/ScreenShot2012-08-06at31802PM.png

  3. drakedanner
    Member
    Posted 1 year ago #

    Please assist.

  4. Flooshy
    Member
    Posted 1 year ago #

    drakedanner,

    I have exactly the same problem.

    With firebug, I can see that it is within the woocommerce.css but if I remove (display:none) it, the title goes with it. It seems that the title and the count are linked together.

    Hope someone has a definite answer.

  5. drakedanner
    Member
    Posted 1 year ago #

    I hope someone helps us out. I saw on another forum someone was able to override the highlight by making the background "important" in style.css I think. I can't write code. Just copy and paste for now haha. Is there a way to make the background color Override the highlight color?

    Thanks.

  6. Flooshy
    Member
    Posted 1 year ago #

    I tried !important but didnt change anything (i am using a picture as background).

  7. drakedanner
    Member
    Posted 1 year ago #

    How could I test that? I'm using a color.

  8. Flooshy
    Member
    Posted 1 year ago #

    You need to add !important; after your background color in your style.css file.
    It should look something similar to:
    body.custom-background {
    background-color: #color code;
    }

    so it becomes:
    body.custom-background {
    background-color: #color code !important;
    }

    give me the link to your site if you want me to have a look

  9. drakedanner
    Member
    Posted 1 year ago #

    Celebrationcosmetics.com

  10. racer x
    Member
    Posted 1 year ago #

    If you want to remove it you have a couple options:

    You can use

    ul.products .count { display:none !important; }

    But use the above in your site css file. Don't use it in the woocommerce css or it will just get overwritten upon updating.

    Woocommerce makes it possible to also adjust any output using one there plugable functions. Though, if you are not comfortable with php, then I advise to only use CSS.

  11. drakedanner
    Member
    Posted 1 year ago #

    So just put it at the bottom of style.css?

  12. racer x
    Member
    Posted 1 year ago #

    Yep. I did exactly that with firebug on your site and it was gone.

  13. drakedanner
    Member
    Posted 1 year ago #

    Thank you so much.

  14. racer x
    Member
    Posted 1 year ago #

    No problem. If you plan on doing lots of editing to a template you should try the free Firebug along with Web developer plugin for Firefox if you don't have it already. It will allow you to edit the css live and target css items quicker.

  15. drakedanner
    Member
    Posted 1 year ago #

    I've seen a lot of good things about it. I need to download Firefox first.

  16. drakedanner
    Member
    Posted 1 year ago #

    adding:

    mark {
    display: none;
    }

    to style.css also works.

  17. Murray644
    Member
    Posted 1 year ago #

    I used both above codes and they worked but removed the number count as well how would I just remove the yellow highlight? I want it to show the number of products but not with the yellow highlight?

  18. drakedanner
    Member
    Posted 1 year ago #

    Murray644,

    Did you try using Flooshy's suggestion?

    You need to add !important; after your background color in your style.css file.
    It should look something similar to:
    body.custom-background {
    background-color: #color code;
    }

    so it becomes:
    body.custom-background {
    background-color: #color code !important;
    }

    give me the link to your site if you want me to have a look

  19. Murray644
    Member
    Posted 1 year ago #

    I actually added this:

    mark{ background:none; }

    and it worked

    Thanks so much!!!!

  20. drakedanner
    Member
    Posted 1 year ago #

    Interesting, I'll have to remember that one. You're welcome and thanks!

  21. daemonicus
    Member
    Posted 1 year ago #

    I tried this:

    ul.products .count { display:none !important; }

    and

    mark {
    display: none;
    }

    and

    mark{ background:none; }

    but no one seems to be working

    http://blumedise├▒o.com/tienda/?page_id=119

    :( :(, it still shows the product count? What can I do? please help me!!!

    thanks in advance

  22. salonmonster
    Member
    Posted 1 year ago #

    You can customize the theme to remove this:

    copy /plugins/woocommerce/templates/content-product_cat.php
    to /themes/YOURTHEME/woocommerce/content-product_cat.php

    Remove the bit that says: $category->count

    By copying the theme file to your own theme directory in a woocommerce folder your changes won't be broken the next time you update woocommerce.

    Hope this helps.

  23. ogdesign
    Member
    Posted 1 year ago #

    Thank you, salonmonster! Problem solved!

  24. James
    Member
    Posted 1 year ago #

    To completely remove the product count shown against each category, just paste the following line into the "Edit CSS" page under "Appearance" in the WP admin area:

    Mark.count{visibility:hidden;}

    Can't remember where I originally found this, but it did the job for me!

    James :)

  25. Patrick Rauland
    Member
    Posted 1 year ago #

    Playing around with CSS isn't very efficient. It is far safer (and easier) to turn it off using the filter WooCommerce added a few months back.

  26. relativist
    Member
    Posted 1 year ago #

    hey there @bftrick, i don't see the filter in the updated woocommerce, though the link you provided says it should be included as part of 2.x. am i missing it?

  27. relativist
    Member
    Posted 1 year ago #

    actually, i'm also noticing that the category count doesn't show in chrome, but it is showing in safari. :/

  28. relativist
    Member
    Posted 1 year ago #

    nope sorry. cleared cache and all working well. thank you!

  29. Flex Perception
    Member
    Posted 1 year ago #

    The best way to do this is not to hide (display: none) or use JQuery, or to have to add another template file (moving content-product-cat.php into your child theme), but to simply re-write the function that does this output.

    Of course, this will remove the Showing results functionality site-wide. In my case, that's what I wanted, I just did not want it showing the number of products anywhere because it will always be a very small number per page or product.

    To do this, place this code in your functions.php file:

    /** Remove Showing results functionality site-wide */
    function woocommerce_result_count() {
            return;
    }
  30. monto
    Member
    Posted 1 year ago #

    Thank you Flex perception... that was a wonderful solution

Topic Closed

This topic has been closed to new replies.

About this Topic