Hide categories that have no visible products
-
Hello,
I’m working on a website where there are visible products (catalog) & hidden products (search). I display categories on the main shop page and subcategories are show on product category pages.I would like to hide product subcategories that have no visible products (or when the product query returns no results).
Any idea ?? ?
Regards,
Tony
-
Hello,
If you are referring to the product categories widget, there is a setting for hiding empty categories:
Link to image: https://snipboard.io/Z0Bogs.jpg
If you are referring to something different, could you please share an example page URL as well as your site’s System Status? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”.? Once you’ve done that, paste it here in your response.
-
This reply was modified 3 years, 6 months ago by
MayKato.
I’m using customize page to display categories on the main shop page and subcategories are show on product category pages :).
### WordPress Environment ###WordPress address (URL): https://serres.ruraweb.fr
Site address (URL): https://serres.ruraweb.fr
WC Version: 5.6.0
REST API Version: ? 5.6.0
WC Blocks Version: ? 5.5.1
Action Scheduler Version: ? 3.2.1
WC Admin Version: ? 2.5.1
Log Directory Writable: ?
WP Version: 5.8
WP Multisite: –
WP Memory Limit: 256 Mo
WP Debug Mode: ?
WP Cron: ?
Language: fr_FR
External object cache: –### Server Environment ###
Server Info: Apache/2.4.25 (Debian)
PHP Version: 7.3.6-1+0~20190531112735.39+stretch~1.gbp6131b7
PHP Post Max Size: 150 Mo
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 7.52.1
OpenSSL/1.0.2rSUHOSIN Installed: –
MySQL Version: 5.5.5-10.1.38-MariaDB-0+deb9u1
Max Upload Size: 10 Mo
Default Timezone is UTC: ?
fsockopen/cURL: ?
SoapClient: ?
DOMDocument: ?
GZip: ?
Multibyte String: ?
Remote Post: ?
Remote Get: ?### Database ###
WC Database Version: 5.6.0
WC Database Prefix: sb_
Taille totale de la base de données: 92.61MB
Taille de la base de données: 49.76MB
Taille de l’index: 42.85MB
sb_woocommerce_sessions: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_woocommerce_api_keys: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_woocommerce_attribute_taxonomies: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_woocommerce_downloadable_product_permissions: Données?: 0.02MB + Index?: 0.06MB + Moteur InnoDB
sb_woocommerce_order_items: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_woocommerce_order_itemmeta: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_woocommerce_tax_rates: Données?: 0.02MB + Index?: 0.06MB + Moteur InnoDB
sb_woocommerce_tax_rate_locations: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_woocommerce_shipping_zones: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_woocommerce_shipping_zone_locations: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_woocommerce_shipping_zone_methods: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_woocommerce_payment_tokens: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_woocommerce_payment_tokenmeta: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_woocommerce_log: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_actionscheduler_actions: Données?: 2.52MB + Index?: 3.25MB + Moteur InnoDB
sb_actionscheduler_claims: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_actionscheduler_groups: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_actionscheduler_logs: Données?: 2.52MB + Index?: 2.03MB + Moteur InnoDB
sb_commentmeta: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_comments: Données?: 0.02MB + Index?: 0.09MB + Moteur InnoDB
sb_dgwt_wcas_index: Données?: 1.52MB + Index?: 0.06MB + Moteur InnoDB
sb_dgwt_wcas_invindex_doclist: Données?: 0.30MB + Index?: 0.30MB + Moteur InnoDB
sb_dgwt_wcas_invindex_info: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_dgwt_wcas_invindex_wordlist: Données?: 0.09MB + Index?: 0.06MB + Moteur InnoDB
sb_dgwt_wcas_tax_index: Données?: 0.02MB + Index?: 0.05MB + Moteur InnoDB
sb_dgwt_wcas_var_index: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_gf_draft_submissions: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_gf_entry: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_gf_entry_meta: Données?: 0.02MB + Index?: 0.05MB + Moteur InnoDB
sb_gf_entry_notes: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_gf_form: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_gf_form_meta: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_gf_form_revisions: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_gf_form_view: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_grp_google_place: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_grp_google_review: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_links: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_options: Données?: 1.36MB + Index?: 0.13MB + Moteur InnoDB
sb_postmeta: Données?: 29.56MB + Index?: 28.08MB + Moteur InnoDB
sb_posts: Données?: 4.52MB + Index?: 1.09MB + Moteur InnoDB
sb_termmeta: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_terms: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_term_relationships: Données?: 1.52MB + Index?: 1.52MB + Moteur InnoDB
sb_term_taxonomy: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_tinvwl_analytics: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_tinvwl_items: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_tinvwl_lists: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_usermeta: Données?: 0.03MB + Index?: 0.03MB + Moteur InnoDB
sb_users: Données?: 0.02MB + Index?: 0.05MB + Moteur InnoDB
sb_wcsp_global_discount_rule_mapping: Données?: 0.02MB + Index?: 0.05MB + Moteur InnoDB
sb_wcsp_group_category_pricing_mapping: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_wcsp_role_category_pricing_mapping: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_wcsp_user_category_pricing_mapping: Données?: 0.02MB + Index?: 0.05MB + Moteur InnoDB
sb_wc_admin_notes: Données?: 0.06MB + Index?: 0.00MB + Moteur InnoDB
sb_wc_admin_note_actions: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_wc_category_lookup: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_wc_customer_lookup: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_wc_download_log: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_wc_order_coupon_lookup: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_wc_order_product_lookup: Données?: 0.02MB + Index?: 0.06MB + Moteur InnoDB
sb_wc_order_stats: Données?: 0.02MB + Index?: 0.05MB + Moteur InnoDB
sb_wc_order_tax_lookup: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_wc_product_meta_lookup: Données?: 1.52MB + Index?: 1.23MB + Moteur InnoDB
sb_wc_reserved_stock: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_wc_tax_rate_classes: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_wc_webhooks: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_wdr_order_discounts: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_wdr_order_item_discounts: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_wdr_rules: Données?: 0.02MB + Index?: 0.00MB + Moteur InnoDB
sb_woocommerce_gc_activity: Données?: 0.02MB + Index?: 0.06MB + Moteur InnoDB
sb_woocommerce_gc_cards: Données?: 0.02MB + Index?: 0.06MB + Moteur InnoDB
sb_woocommerce_pickup_locations_geodata: Données?: 0.02MB + Index?: 0.05MB + Moteur InnoDB
sb_wusp_group_product_price_mapping: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_wusp_role_pricing_mapping: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_wusp_rules: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_wusp_subrules: Données?: 0.02MB + Index?: 0.08MB + Moteur InnoDB
sb_wusp_user_pricing_mapping: Données?: 0.02MB + Index?: 0.05MB + Moteur InnoDB
sb_yoast_indexable: Données?: 2.52MB + Index?: 2.72MB + Moteur InnoDB
sb_yoast_indexable_hierarchy: Données?: 0.36MB + Index?: 0.47MB + Moteur InnoDB
sb_yoast_migrations: Données?: 0.02MB + Index?: 0.02MB + Moteur InnoDB
sb_yoast_primary_term: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB
sb_yoast_seo_links: Données?: 0.02MB + Index?: 0.03MB + Moteur InnoDB### Post Type Counts ###
acf-field: 79
acf-field-group: 4
attachment: 17
conseils: 3
customize_changeset: 1
flamingo_contact: 1
nav_menu_item: 9
oembed_cache: 2
page: 9
product: 8368
product_variation: 278
revision: 129
sectionslogiques: 1
wc_pickup_location: 1
wp_block: 5### Security ###
Secure connection (HTTPS): ?
Votre boutique n’utilise pas HTTPS. En savoir plus sur HTTPS et les certificats SSL.
Hide errors from visitors: ?Les messages d’erreur ne doivent pas s’afficher aux visiteurs.### Active Plugins (8) ###
FiboSearch – AJAX Search for WooCommerce (Pro): par FiboSearch Team – 1.13.0
Advanced Custom Fields PRO: par Delicious Brains – 5.10.1
Akismet Anti-Spam: par Automattic – 4.1.11
TI WooCommerce Wishlist: par TemplateInvaders – 1.28.3
WooCommerce Bulk Discount: par Rene Puchinger – 3.0
WooCommerce Local Pickup Plus: par SkyVerge – 2.9.2
WooCommerce: par Automattic – 5.6.0
Yoast SEO: par Team Yoast – 17.0### Inactive Plugins (4) ###
Gravity Forms: par Gravity Forms – 2.4.22.4
WooCommerce added to cart popup (Ajax): par XootiX – 1.5
WooCommerce Gift Cards: par SomewhereWarm – 1.5.2
WPC Product Bundles for WooCommerce (Premium): par WPClever.net – 5.1.2### Settings ###
API Enabled: –
Force SSL: –
Currency: EUR (€)
Currency Position: right_space
Thousand Separator: .
Decimal Separator: ,
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)Connected to WooCommerce.com: –
### WC Pages ###
Base de la boutique: #10 – /boutique/
Panier: #11 – /panier/
Commander: #12 – /validation-commande/
Mon compte: #13 – /compte-personnel/
Conditions générales de vente et d’utilisation: ? Page non définie### Theme ###
Name: SERRES BARREAU
Version: (une mise à jour de la version 0 est disponible)
Author URL: https://www.ruraweb.fr
Child Theme: ? – Si vous modifiez WooCommerce sur un thème parent que vous n’avez pas construit personnellement
nous vous recommandons d’utiliser un thème enfant. Voir?: Comment créer un thème enfantWooCommerce Support: ?
### Templates ###
Overrides: serres/woocommerce/archive-product.php
serres/woocommerce/cart/cart-empty.php
serres/woocommerce/cart/cart-shipping.php
serres/woocommerce/cart/cart.php
serres/woocommerce/checkout/form-checkout.php
serres/woocommerce/checkout/review-order.php version 3.8.0 est obsolète. La version du noyau est 5.2.0
serres/woocommerce/content-product-cat.php
serres/woocommerce/content-product.php
serres/woocommerce/global/quantity-input.php
serres/woocommerce/global/wrapper-end.php
serres/woocommerce/global/wrapper-start.php
serres/woocommerce/loop/add-to-cart.php
serres/woocommerce/loop/orderby.php
serres/woocommerce/loop/price.php
serres/woocommerce/single-product/add-to-cart/simple.php
serres/woocommerce/single-product/meta.php
serres/woocommerce/single-product/rating.php
serres/woocommerce/single-product/related.php
serres/woocommerce/single-product/review-meta.php
serres/woocommerce/single-product/review.php
serres/woocommerce/single-product/tabs/additional-information.php
serres/woocommerce/single-product/tabs/description.php
serres/woocommerce/single-product/tabs/tabs.php
serres/woocommerce/single-product/title.php
serres/woocommerce/single-product-reviews.phpOutdated Templates: ?
Apprenez comment mettre à jour
### Local Pickup Plus ###
Status: ? Activé
Geocoding: –
Pickup Locations: 1
Pickup Appointments: ? Obligatoire
Pickup Location Tax: –
Checkout Display: Mode de sélection du retrait: par commandeMode de gestion d’un article du panier: regroupement automatiqueGestion d’un article du panier par défaut: récupérer les articles### TI WooCommerce Wishlist Templates ###
Overrides: –
### Action Scheduler ###
Terminé: 9?238
Oldest: 2021-08-31 11:01:33 +0200
Newest: 2021-09-02 18:43:12 +0200### Status report information ###
Generated at: 2021-09-02 18:53:38 +02:00
`Hi @ruraweb,
I’m using customize page to display categories on the main shop page and subcategories are show on product category pages ??
If your using the settings located at Appearance > Customize > WooCommerce > Product Catalog to configure the page display the only settings available for that would be these below.
Image Link: https://cloudup.com/cdVsIsgYs3Q
Hi @ruraweb
We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.
-
This reply was modified 3 years, 6 months ago by
- The topic ‘Hide categories that have no visible products’ is closed to new replies.