Open the reviews accordion item when clicking on reviews star badge on product pages

mustaphadem
Tourist
7 0 0

Hello,

I have placed the review star badge right under my product title and i would like the users, when they click on that badge, i want the page to jump to the reviews section on the bottom and open that accordion element.

I believe this requires some sort of javascript function but i am not really familiar with it. 

this is the line item on product-form.liquid for the star badge to show on the product pages;

<a href="#1500666216949"><span class="shopify-product-reviews-badge" data-id="{{ product.id }}"></span></a>

 

#1500666216949 is the id of the review accordion section. 

 

Any help is greatly appreciated, thank you!

 

0 Likes