Last active
March 9, 2019 20:51
-
-
Save gstricklind/13e2f4ba5ff2b39bca9415d4908fee18 to your computer and use it in GitHub Desktop.
Add Write A Review link to woocommerce product pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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