Site logo

[Resolved] remove woocommerce product category count on shop page

Home Forums Support [Resolved] remove woocommerce product category count on shop page

Home Forums Support remove woocommerce product category count on shop page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1690201
    Pauline

    Hi

    I would like to remove the woocommerce product category count on the shop page. I have tried pasting the following into “Additional CSS” but neither seem to work. Can you advise what I am doing wrong? Thanks!

    .woocommerce-loop-category__title mark.count {
    display: none;
    }

    .woocommerce-loop-category__title mark.count {
    display: none;
    }

    #1690213
    Ying
    Staff
    Customer Support

    Hi Pauline,

    There should be a space between the 2 levels, try this:

    .post-type-archive-product .woocommerce-loop-category__title .count {
        display: none;
    }
    #1690901
    Pauline

    Hi Ying

    Thanks for looking into this 🙂 but the CSS does not remove the product count. Do you have something else I could try?

    Pauline

    #1691041
    David
    Staff
    Customer Support

    Hi there,

    try adding this PHP Snippet:

    add_filter( 'woocommerce_subcategory_count_html', 'db_remove_cat_prod_count' );
    function db_remove_cat_prod_count() {
    
      return;
    
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #1692144
    Pauline

    Thanks so much David – it worked perfectly 🙂

    #1692335
    David
    Staff
    Customer Support

    You’re welcome

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.