‘No products found which match your selection’ messages

Hello,
I just purchased ‘groups restrict categories’ plugin to hide product categories from non-logged in users. It blocks non-logged in users but it shows ‘No products found which match your selection’ message which is found in no-product-found.php.

I don’t want people to think that I don’t have any items in that categories. so would you please tell me how to change that message to ‘you must log in to view products’ ?

ps: I don’t want to change that message in ‘no-product-found.php’


Comments

6 responses to “‘No products found which match your selection’ messages”

  1. jiyoung Avatar
    jiyoung

    Hello,

    I want to leave ‘No products found which match your selection’ message as it is for the search result and create ‘Please log in to view products.’ messages for the non-login users.

    I pasted in pastebin.com

    http://pastebin.com/LVTEkeNd

    Thank you,

    Please, help me to fix this problem.

    1. antonio Avatar
      antonio

      Hi,
      I hope this code helps you.
      cheers

      1. jiyoung Avatar
        jiyoung

        Thank you very much for your reply,
        The code you sent me worked and saved my day!

  2. jiyoung Avatar
    jiyoung

    Hello,
    I don’t quite understand how to incorporate

    if ( !is_user_logged_in() ) {
    _e( 'Please log in to view products.' );
    }

    into my theme>woocommerce/loop/no-products-found.php

    This is a copy of my theme (zonda)>woocommerce/loop/no-products-found.php

    Toggle

    1. antonio Avatar
      antonio

      Hi,
      please use pastebin.com to shown us your file.
      cheers

  3. The solution for this is to customize the template but instead of hacking the template within woo commerce, you override the template by copying it to yourtheme/woocommerce/loop/no-products-found.php

    There you would use for example:

    if ( !is_user_logged_in() ) {
    _e( 'Please log in to view products.' );
    }

    Reference:

    https://github.com/woothemes/woocommerce/blob/master/templates/loop/no-products-found.php

    In other words, you should not customize the default template but create a customized copy in your theme.

Share