Wednesday 27 February 2019

How to Add Custom Fields to Comments Form in Woocommerce 3

Example

I'm trying to add a "Phone" field in the product comments (Woocomerce 3+).

I try this code, but this not work:

function true_phone_number_field( $fields ) {
$fields['phone'] = '<p class="comment-form-phone"><label for="phone">Phone</label> <input id="phone" name="phone" type="text" value="" size="30" /></p>';

add_filter( 'comment_form_default_fields', 'true_phone_number_field');



from How to Add Custom Fields to Comments Form in Woocommerce 3

No comments:

Post a Comment