• I was wondering if there’s a way to place a button at the top of this page that takes you to the where the reviews start. It should also be with all the other products. I’d like the button to be placed around here https://imgur.com/a/4jZwoU8

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Saif

    (@babylon1999)

    Hello @kieronbishop,

    I’m not sure if it’s possible to add the button exactly where you want without editing the templates.

    However, if you’re comfortable with the button being placed above the title, you can use the woocommerce_before_single_product_summary hook to append it.

    Example:

    /*  add reviews button on single product page */
    
    function add_reviews_button() {
       echo '<button class="reviews-button"><a href="#tab-title-reviews">See Reviews</a></button>';
    }
    add_filter( 'woocommerce_before_single_product_summary', 'add_reviews_button', 10 );




    Link to image: https://d.pr/i/9P4l7C

    You can add the snippet to your functions.php file or use a plugin like Code snippet.

    Hope this helps!

    Thread Starter kieronbishop

    (@kieronbishop)

    Sorry for the long wait with no response, I’ve been busy recently. The button does work, but I wanted it to go to the section of my website titled “Leave a review” (it’s a good way down the page.) Basically the bottom of the reviews. Do you know how I would do that or is that a question for the Ultimate Review plugin forum? I feel like if I ask there they might say “that’s a question for the storefront forum.”

    Saif

    (@babylon1999)

    Basically the bottom of the reviews. Do you know how I would do that or is that a question for the Ultimate Review plugin forum? I feel like if I ask there they might say “that’s a question for the storefront forum.”

    You can try replacing the href id with the id of any element on the page. Here’s a screenshot for reference: https://d.pr/i/P3kZY9

    I can see three review forms so I’m not which one you’re referring to, I’ve edited the snippet to jump to the last one.

    /*  add reviews button on single product page */
    
    function add_reviews_button() {
       echo '<button class="reviews-button"><a href="review">See Reviews</a></button>';
    }
    add_filter( 'woocommerce_before_single_product_summary', 'add_reviews_button', 10 );

    Make sure to remove the previous snippet before adding the one above.

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add a button that scrolls down the page?’ is closed to new replies.