Update product rating counts after adding a rating
This commit is contained in:
parent
bbd54cc15f
commit
38cd9b4df7
|
@ -205,6 +205,11 @@ class WC_Comments {
|
|||
return;
|
||||
}
|
||||
add_comment_meta( $comment_id, 'rating', (int) esc_attr( $_POST['rating'] ), true );
|
||||
|
||||
$post_id = isset( $_POST['comment_post_ID'] ) ? (int) $_POST['comment_post_ID'] : 0;
|
||||
if ( $post_id ) {
|
||||
self::clear_transients( $post_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue