Domanda

Devo aggiungere ulteriori campi a un sistema di valutazione del prodotto WooCommerce come questo:enter image description here

Ho aperto questo file:/wp-content/plugins/wooocommerce/modelli/singolo prodotto-reviews.php e ho visto le seguenti righe:

$comment_form = array(
        'title_reply' => $title_reply,
        'comment_notes_before' => '',
        'comment_notes_after' => '',
        'fields' => array(
            'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name', 'woocommerce' ) . '</label> ' . '<span class="required">*</span>' .
                        '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" aria-required="true" /></p>',
            'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email', 'woocommerce' ) . '</label> ' . '<span class="required">*</span>' .
                        '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" aria-required="true" /></p>',
        ),
        'label_submit' => __( 'Submit Review', 'woocommerce' ),
        'logged_in_as' => '',
        'comment_field' => ''
    );

e questo

$comment_form['comment_field'] = '<p class="comment-form-rating"><label for="rating">' . __( 'Rating', 'woocommerce' ) .'</label><select name="rating" id="rating">
            <option value="">'.__( 'Rate&hellip;', 'woocommerce' ).'</option>
            <option value="5">'.__( 'Perfect', 'woocommerce' ).'</option>
            <option value="4">'.__( 'Good', 'woocommerce' ).'</option>
            <option value="3">'.__( 'Average', 'woocommerce' ).'</option>
            <option value="2">'.__( 'Not that bad', 'woocommerce' ).'</option>
            <option value="1">'.__( 'Very Poor', 'woocommerce' ).'</option>
        </select></p>';

C'è un modo per aggiungere un altro input selezionato?

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a wordpress.stackexchange
scroll top