Woocommerce product review fields customization
-
I need help with the Woocommerce product review fields. I am letting customers buy products as a guest, so they wouldn’t register on my website.
So when they don’t register, they have to leave a review as a guest (with name and email address).
What issue I am facing here is, when they rate the review, the “Name & Email” fields are blank. There is no placeholder text or label for them to identify that those are name and email address fields.
So can you please help me to customize those fields and add a placeholder text or label for those 2 fields?
Code:
if ( wc_review_ratings_enabled() ) {
$comment_form[‘comment_field’] = ‘<div class=”comment-form-rating”><label for=”rating”>’ . esc_html__( ‘Your rating’, ‘woocommerce’ ) . ( wc_review_ratings_required() ? ‘ <span class=”required”>*</span>’ : ” ) . ‘</label><select name=”rating” id=”rating” required>
<option value=””>’ . esc_html__( ‘Rate…’, ‘woocommerce’ ) . ‘</option>
<option value=”5″>’ . esc_html__( ‘Perfect’, ‘woocommerce’ ) . ‘</option>
<option value=”4″>’ . esc_html__( ‘Good’, ‘woocommerce’ ) . ‘</option>
<option value=”3″>’ . esc_html__( ‘Average’, ‘woocommerce’ ) . ‘</option>
<option value=”2″>’ . esc_html__( ‘Not that bad’, ‘woocommerce’ ) . ‘</option>
<option value=”1″>’ . esc_html__( ‘Very poor’, ‘woocommerce’ ) . ‘</option>
</select></div>’;
}$comment_form[‘comment_field’] .= ‘<p class=”comment-form-comment”><label for=”comment”>’ . esc_html__( ‘Your review’, ‘woocommerce’ ) . ‘ <span class=”required”>*</span></label><textarea id=”comment” name=”comment” cols=”45″ rows=”8″ required></textarea></p>’;
comment_form( apply_filters( ‘woocommerce_product_review_comment_form_args’, $comment_form ) );
The page I need help with: [log in to see the link]
The topic ‘Woocommerce product review fields customization’ is closed to new replies.