Last active
December 5, 2023 13:59
-
-
Save roykho/9292693 to your computer and use it in GitHub Desktop.
WooCommerce: How to remove star review rating under the product title when enable review is off.
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
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 ); | |
add_action( 'woocommerce_single_product_summary', 'my_woocommerce_template_single_rating', 10 ); | |
function my_woocommerce_template_single_rating() { | |
global $product; | |
if ( $product->post->comment_status === 'open' ) | |
wc_get_template( 'single-product/rating.php' ); | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment