WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Protect a product by password (6 posts)

  1. aguidis
    Member
    Posted 1 year ago #

    Hello,

    I'm working on an airsoft website that allows people to reserve matches. My client would like to set some private matches. Only accessible with a specific password.

    I try to set the visibility of my product : protected by password but it still accessible.

    Is there method to implement this kind of protection or a plugin maybe ?

    http://wordpress.org/extend/plugins/woocommerce/

  2. IgniteWoo
    Member
    Posted 1 year ago #

    Yes. When editing a product look in the right sidebar for the Publish box. In there click "edit" next to Visibility.

  3. aguidis
    Member
    Posted 1 year ago #

    I already tried like I said :) I don't have any password form.

  4. IgniteWoo
    Member
    Posted 1 year ago #

    Oh right, apologies. This is probably a theme issue. If you check it in a stock theme you'll see a password form if a product has a password. At least that's what I see when I test with TwentyEleven or WooThemes Canvas.

  5. aguidis
    Member
    Posted 1 year ago #

    Thank you for your reply. Indeed I think it's a theme issue : I created my own theme. I thought the function the_content() could handle each kind of visibility. So I have to inspect the TwentyEleven theme in order to get the good snippets ?

  6. aguidis
    Member
    Posted 1 year ago #

    I post what I found :

    I updated content-single-product.php and I put this condition :

    if ( !post_password_required() ) {
        // Display your product
    } else {
        echo get_the_password_form();
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic