WordPress.org

Ready to get started?Download WordPress

Forums

YITH WooCommerce Wishlist
how to use add to wish list is availabe for logged users (5 posts)

  1. sunil ch
    Member
    Posted 5 months ago #

    Hi
    i am trying to make add to wish list button is available only for logged in users

    if the user is not logged in the it will ask for login

    any suggestions

    Thanks in advance

    https://wordpress.org/plugins/yith-woocommerce-wishlist/

  2. kamleshpawar2006
    Member
    Posted 2 months ago #

    hi sunil,
    i also wants this functionality, have you found any solution on this?

  3. gphx
    Member
    Posted 1 month ago #

    I'm also looking for a solution to this. Any luck?

  4. gphx
    Member
    Posted 1 month ago #

    The solution I am using: hide the actual wishlist page for logged-out users. When they click the 'Wishlist' page, it will re-direct them to the Register page. If they're logged in, it will take them to the Wishlist page.

    Add this code to your functions.php file - hope this helps!

    add_action( 'template_redirect', 'redirect_to_specific_page' );
    
    function redirect_to_specific_page() {
    
    if ( is_page('slug') && ! is_user_logged_in() ) {
    
    wp_redirect( 'http://www.example.dev/your-page/', 301 );
      exit;
        }
    }
  5. rms9886
    Member
    Posted 1 day ago #

    hi ghpx
    i am trying to make add to wish list button is available only for logged in users
    I placed your code in functions.php but no luck
    Please any further help would be appreciated.

    Thanks in advance

Reply

You must log in to post.

About this Plugin

About this Topic

Tags