geobikas
geobikas

Reputation: 23

Woocoomerce remove product count from attributes

On a WordPress installation with Woocommerce I have an issue with wrong number of product count on the frontend. That's why I decided to remove it. I have remove it from sidebars and anywhere with snippets but not on product attributes.

Is there any snipped to fix that?

enter image description here

Upvotes: 2

Views: 3588

Answers (4)

Dsda
Dsda

Reputation: 577

If you want really remove (not just hide) you need to edit your theme function.php file by adding at the end this code:

add_filter( 'woocommerce_layered_nav_count', '__return_false' );

It's work for WOOCommerce v 3.4.3

Upvotes: 3

Howli
Howli

Reputation: 12469

Adding

small.count 
{
    display: none !important;
}

to your style sheet should work. It should hide the product count.

Upvotes: 0

geobikas
geobikas

Reputation: 23

i think i allready have that.

See what functions.php file includes

<?php
define('ETHEME_DOMAIN', 'legenda');
require_once( get_template_directory() . '/framework/init.php' );

add_filter( 'woocommerce_subcategory_count_html', 'jk_hide_category_count' );
function jk_hide_category_count() {
    // No count
}

add_filter( 'woocommerce_subcategory_count_html', 'woo_remove_category_products_count' );

function woo_remove_category_products_count() {
  return;
}

you can swee live that is not worked at http://www.karadimos.gr/product-category/xalia/

BTW thanx for your reply!!!

Upvotes: 0

Waseem Senjer
Waseem Senjer

Reputation: 1048

Here is a quick snippet to remove products count after categories names using WooCommerce. It’s pretty useful in particular when your main shop page list categories instead of listing products. you can put it in 'functions.php' file in your theme.

add_filter( 'woocommerce_subcategory_count_html', 'woo_remove_category_products_count' );

function woo_remove_category_products_count() {
  return;
}

Upvotes: 2

Related Questions