• Resolved Paul_N

    (@paul_n)


    Updated to the new version a few days ago.

    When replying to a product review we get the error message in admin ‘Please rate the product.’

    Ratings are required to leave a customer review but this is the first time an admin reply was asked to supply a rating, which of course isn’t possible from admin anyway.

    This doesn’t happen when replying to a standard wordpress comment, such as the example comment provided, only product reviews.

    Anyone have an insight to this at all?

    https://wordpress.org/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Paul_N

    (@paul_n)

    The problem seems to be with class-wc-comments.php

    If I use the Woocommerce 2.2 version of this on my dev site the problem goes away.

    Is there a fix needed here?

    I can see that it is likely this code that is the reason:

    /**
    	 * Validate the comment ratings.
    	 * @param  array $comment_data
    	 * @return array
    	 */
    	public static function check_comment_rating( $comment_data ) {
    		// If posting a comment (not trackback etc) and not logged in
    		if ( 'product' === get_post_type( $_POST['comment_post_ID'] ) && empty( $_POST['rating'] ) && '' === $comment_data['comment_type'] && 'yes' === get_option( 'woocommerce_review_rating_required' ) ) {
    			wp_die( __( 'Please rate the product.', 'woocommerce' ) );
    			exit;
    		}
    
    		return $comment_data;
    	}
    
    	/**

    I’m wary of making any such change to my live site unless someone can confirm it will do no harm.

    Thread Starter Paul_N

    (@paul_n)

    I see that this behaviour is the result of this ‘fix’

    https://github.com/woothemes/woocommerce/issues/7371

    I’m not entirely sure I understand the need for this fix, one removes the ratings HTML and yet still requires that a rating be given? am I misunderstanding something here?

    This code change stops admin’s ability to reply to a review, it requests that they supply a rating for their own product from within admin, which is impossible.

    So at the moment my client cannot respond to any of their customer reviews from within admin.

    Thread Starter Paul_N

    (@paul_n)

    Issue resolved here, thank you Mike.

    https://github.com/woothemes/woocommerce/issues/7679

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘review/comment reply problem’ is closed to new replies.