Skip to content

Instantly share code, notes, and snippets.

@gstricklind gstricklind/custom.js
Last active Mar 9, 2019

Embed
What would you like to do?
Add Write A Review link to woocommerce product pages
//https://ginastricklind.com/how-to-add-write-your-review-link-to-woocommerce-product-page/
(function($){
$('.woocommerce-product-rating .woocommerce-review-link').after(' | <a class="write-your-review" href="#tab-reviews">Write Your Review</a>');
$('.write-your-review').click( function () {
$('.tabs li').removeClass('active');
$('.woocommerce-Tabs-panel').attr("style", "display:none");
$('.reviews_tab').addClass('active');
$('.woocommerce-Tabs-panel--reviews').attr("style", "display:block");
$('html, body').animate({
scrollTop: $("#commentform").offset().top -200
}, 1500);
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.