• Resolved believer99

    (@believer99)


    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]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @believer99!

    Since this requires custom coding, which is outside our scope of support, I am leaving this thread open for a bit to see if anyone can chime in to help you out.

    For additional assistance on this topic, we recommend getting in touch with one of the customization experts listed on the WooCommerce Customizations Page; they can help you with the code you need.

    Also, if you are into coding, you can visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack, you could find help from the community of open-source developers for WooCommerce that hangs in there.

    Cheers!

    Hi there,

    We haven’t heard back from you in a while, so I’m marking this thread as resolved.

    Hopefully, the provided information was helpful, and you solved the issue. If you have any further questions, we recommend creating a new thread.

    Cheers!

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

The topic ‘Woocommerce product review fields customization’ is closed to new replies.