Hello!
I got the code below from ChatGPT but couldn’t debug it. It almost works except the original text I want to replace is still present but to the right.
Right now it says: “1 customer review” if it’s one or “\[number\_of\_reviews\] customer review**s**” if it’s more than one. I want it to say
‘Ver 1 avaliação” and “Ver \[number\_of\_reviews\] avaliações”, respectively:
add_filter( ‘woocommerce_product_review_count’, ‘custom_product_review_count’, 10, 2 );
function custom_product_review_count( $count, $product ) {
return sprintf( ‘Ver %d avaliaç%s’, $count, ( $count > 1 ? ‘ões’ : ‘ão’ ) );
}
This code also had the same problem:
add_filter( ‘woocommerce_product_review_count’, ‘custom_product_review_count’, 10, 2 );
function custom_product_review_count( $count, $product ) {
return ‘Ver ‘ . $count . ‘ avaliaç’ . ( $count > 1 ? ‘ões’ : ‘ão’ );
}
Thanks a lot!
[ad_2]