Commit 18a7a6ce15 for woocommerce
commit 18a7a6ce156544612b597c0ba4589f1919194de2
Author: Tung Du <dinhtungdu@gmail.com>
Date: Fri Apr 18 16:11:48 2025 +0700
Fix star rating issue for the product review form when multiple Product Reviews blocks are added (#57383)
* Fix star rating issue
* chore: changelog
---------
Co-authored-by: Lourens Schep <lourensschep@gmail.com>
diff --git a/plugins/woocommerce/changelog/wooplug-2582-double-rating-shows-up-in-product-reviews-when-another b/plugins/woocommerce/changelog/wooplug-2582-double-rating-shows-up-in-product-reviews-when-another
new file mode 100644
index 0000000000..dd997f1fbf
--- /dev/null
+++ b/plugins/woocommerce/changelog/wooplug-2582-double-rating-shows-up-in-product-reviews-when-another
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Fix Star rating issue when when there are multiple Product Reviews blocks on the same page.
diff --git a/plugins/woocommerce/client/legacy/js/frontend/single-product.js b/plugins/woocommerce/client/legacy/js/frontend/single-product.js
index a70c18f5b7..57938f7ab2 100644
--- a/plugins/woocommerce/client/legacy/js/frontend/single-product.js
+++ b/plugins/woocommerce/client/legacy/js/frontend/single-product.js
@@ -99,7 +99,7 @@ jQuery( function( $ ) {
} )
// Star ratings for comments
.on( 'init', '#rating', function() {
- $( '#rating' )
+ $( this )
.hide()
.before(
'<p class="stars">\