Support » Plugin: WooCommerce » Empty Category Message

  • Resolved frabie

    (@frabie)


    We have a dedicated category links in our main WordPress Menu.
    From time to time there will be categories that need to be empty, ie. if there is no current events related products. We do not want to remove the link everytime there is no items in it. Rather we would like to display an message instead when an empty category page is opened.
    Example:

    There are no items in this category. Please check back soon or visit our shop page [link] to see all available products.

    Currently, when an empty category page is opened it shows a blank page.

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

Viewing 1 replies (of 1 total)
  • Plugin Support Michael

    (@mikkamp)

    Automattic Happiness Engineer

    Hi,

    By default it will display the message “No products were found matching your selection” on an empty category page. However you might have something in your theme which adjusts this if you just get an empty page. If this text is showing up you can use a translation plugin to customize it. I’d suggest having a look at Loco Translate: https://wordpress.org/plugins/loco-translate/

    Another alternative is to override the template file which is used for this. By default if a category is empty it will display the template file loop/no-products-found.php
    You can override this template by copying it to the following location within your child theme: yourtheme/woocommerce/loop/no-products-found.php

    If needed you can use one of the conditional functions like is_product_category to only display your custom message when it’s a category page.

Viewing 1 replies (of 1 total)
  • The topic ‘Empty Category Message’ is closed to new replies.