• Resolved nabeel13

    (@nabeel13)


    Hi,

    Please can I get assistance with how to remove the “Woocommerce Results Count”?

    I’m trying to remove the “Woocommerce Result Count” from the Shop page in question.

    I’ve added the following code to the functions.php file, however, the results count has not been removed:

    remove_action( 'woocommerce_before_shop_loop' , 'woocommerce_result_count', 20 );
    remove_action( 'woocommerce_after_shop_loop' , 'woocommerce_result_count', 20 );

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter nabeel13

    (@nabeel13)

    This CSS code has removed the “Woocommerce Result Count”.

    .products.columns-4, .woocommerce-result-count, .orderby {
    
                    display: none;

    However, the “Woocommerce Result Count” is still being loaded on the page.

    Plugin Support Riaan K.

    (@riaanknoetze)

    Hi there,

    I’ve just had a look at the page in question but didn’t see any reference to that text:


    Link to image: https://d.pr/i/9veUxD

    If you’re still seeing that on your side, would you mind highlighting that in a screenshot?

    Thanks!

    Thread Starter nabeel13

    (@nabeel13)

    Hi @riaanknoetze

    I hope you are well and thank you for your reply.

    Please can you view the page in question as I have removed the CSS from the website.

    Here is a screen grab of the results count I want to remove from the “Shop” page:
    Screen Grab

    Plugin Support Kel C. a11n

    (@kellymetal)

    Hi there,

    I understand you are trying to remove the product result count text from your Shop page. You were able to remove it via CSS, but want to completely prevent it from loading in the page, rather than just hiding it.

    Please try the remove_action calls from your initial message in a function like this so that they run after the theme setup is complete:

    
    add_action( 'after_setup_theme', 'my_remove_product_result_count', 99 );
    function my_remove_product_result_count() { 
        remove_action( 'woocommerce_before_shop_loop' , 'woocommerce_result_count', 20 );
        remove_action( 'woocommerce_after_shop_loop' , 'woocommerce_result_count', 20 );
    }
    

    While the remove_actions alone did not work for me, calling them like this did the trick on my test site with the default Storefront theme.

    I hope that helps!

    Thread Starter nabeel13

    (@nabeel13)

    Hi @kellymetal,

    I hope you are well and thank you for your assistance.

    However, what you have suggested has not removed the results count from the “Shop” page.

    Do you suggest anything else that can remove the results count from the “Shop” page?

    Thank you.

    Plugin Support Kel C. a11n

    (@kellymetal)

    Hi there @nabeel13,

    Using the above snippet works with the core WooCommerce plugin + the default Storefront theme. Without the snippet it displays like this:

    product count
    Link to image: https://d.pr/i/7Dgpzx

    While adding the snippet shows as follows:

    no product count
    Link to image: https://d.pr/i/wakkEt

    If the snippet is not working on your site, then your theme is most likely changing the way things are being added/displayed on the page. Taking a look at the source code of your page, I see you are using an “Alone” theme. I would recommend reaching out to the developers of that theme to ask about the best way to remove the results count, since it looks like it will depend on the code in their theme:
    https://themeforest.net/item/alone-charity-multipurpose-nonprofit-wordpress-theme/15019939

    I hope that helps! Best of luck, and have a wonderful day!

    Thread Starter nabeel13

    (@nabeel13)

    Hi @kellymetal,

    Thank you for your assistance.

    I have contacted the developers from Bears Themes, but they have not replied, this may be due to their support policy – they only offer support for their purchased themes for 6 months (unless extended) after the initial purchase date (this theme was purchased over 2 years ago).

    Is there a way to hide results count on a particular page using CSS? If so, what would the CSS code be?

    Plugin Support Kel C. a11n

    (@kellymetal)

    Hi there @nabeel13,

    Yes, it would be possible to remove the result count via CSS as well. This should do it on the shop page:

    
    .woocommerce-result-count {
      display: none;
    }
    

    If you were trying to hide it just on a specific page (like if you had a loop displaying products on a different page), then you would need to add the class for that page ID before that, for example:

    
    .page-id-1365 .woocommerce-result-count {
      display: none;
    }
    

    I hope that helps!

    Thread Starter nabeel13

    (@nabeel13)

    Hi @kellymetal

    Thank you for the CSS code that you provided and for your invaluable assistance, it is greatly appreciated.

    I hope you have a great day.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Remove Woocommerce Result Count’ is closed to new replies.