Support » Plugin: YITH WooCommerce Advanced Reviews » Link to Login page

  • omarperez999

    (@omarperez999)


    Hello — is it possible add a link to login somewhere? Preferably under the text that says:

    Reviews
    There are no reviews yet.

    Only logged in customers who have purchased this product may write a review.

    Thank you!

    Op

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hello there,

    hope you are doing well 🙂

    In this case, to achieve what you need, you will need to override a plugin template into your theme. We will give you all the necessary steps to achieve this:

    1. First of all, you will need to copy the ywar-product-reviews.php template (found in yith-woocommerce-advanced-reviews/templates) and paste it into your active theme in wp-content/themes/your_active_theme/woocommerce.

    2. Then, open the modified template in your theme, and paste the following code after the line 80:

    <?php
    			if ( ! is_user_logged_in() ) {
    				?>
    					<p>Please<a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>">, login</a> to be able to submit a review</p>
    				<?php
    			}
    		?>

    With this code, a new link to redirect to the My Account page will be inserted only for not logged in customers.

    Let us know any news, please.

    Have a nice day!

    Thread Starter omarperez999

    (@omarperez999)

    Hi there, and thanks! Sounds great.

    One more question: once they do log in, they will be at the backend, and not be directed to the product itself, right? So they would have to go to their orders section?

    Cheers — Op

    Plugin Author YITHEMES

    (@yithemes)

    Hi there,

    You are welcome! 🙂

    Right, when they log in they will not be redirected to the product again, they will be in their accounts.

    To achieve it you will need a custom code or an external plugin, as at the moment we don’t have a solution for it.

    If you have any doubt let us know and we will be happy to help you.

    Have a nice day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Link to Login page’ is closed to new replies.