Exemplo n.º 1
0
	<?php 
$aria_req = $req ? " aria-required='true'" : '';
$comment_args = array('title_reply' => '<h4 class="heading"><span>' . __('Leave a Comment', 'marvel') . '</span></h3>', 'comment_field' => '<div class="form-group">
                                                <label class="field-label" for="comment">Comment:</label>
                                                <textarea rows="8" id="comment" class="form-control"  name="comment"' . $aria_req . '></textarea>
                                            </div>', 'fields' => apply_filters('comment_form_default_fields', array('author' => '<div class="row"><div class="col-md-6"><div class="form-group">
                                            <label for="author">Name:</label>
                                            <input type="text" name="author" class="form-control" id="author" value="' . esc_attr($commenter['comment_author']) . '" ' . $aria_req . ' />
                                            </div></div>', 'email' => '<div class="col-md-6"><div class="form-group">
                                            <label for="email">Email:</label>
                                            <input id="email" name="email" class="form-control" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" ' . $aria_req . ' />
                                            </div></div></div>', 'url' => '<div class="form-group">
                                            <label for="url">Website:</label>
                                            <input id="url" name="url" class="form-control" type="text" value="' . esc_attr($commenter['comment_author_url']) . '"  />
                                            </div>')), 'label_submit' => 'Post Comment', 'comment_notes_before' => '<p class="h-info">' . __('Your email address will not be published.', 'marvel') . '</p>', 'comment_notes_after' => '');
?>
	<?php 
global $post;
?>
	<?php 
if ('open' == $post->comment_status) {
    ?>
	<div class="commentform">
			<?php 
    pgl_comment_form($comment_args, 'btn-primary');
    ?>
    </div><!-- end commentform -->
	<?php 
}
?>
</div><!-- end comments -->
			<div id="review_form">
				<?php 
    $commenter = wp_get_current_commenter();
    $comment_form = array('title_reply' => have_comments() ? __('Add a review', 'woocommerce') : __('Be the first to review', 'woocommerce') . ' &ldquo;' . get_the_title() . '&rdquo;', 'title_reply_to' => __('Leave a Reply to %s', 'woocommerce'), 'comment_notes_before' => '', 'comment_notes_after' => '', 'fields' => array('author' => '<p class="comment-form-author">' . '<label for="author">' . __('Name', 'woocommerce') . ' <span class="required">*</span></label> ' . '<input class="form-control" 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') . ' <span class="required">*</span></label> ' . '<input class="form-control" id="email" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30" aria-required="true" /></p>'), 'label_submit' => __('Submit', 'woocommerce'), 'logged_in_as' => '', 'comment_field' => '');
    if (get_option('woocommerce_enable_review_rating') === 'yes') {
        $comment_form['comment_field'] = '<p class="comment-form-rating"><label for="rating">' . __('Your 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>';
    }
    $comment_form['comment_field'] .= '<p class="comment-form-comment"><label for="comment">' . __('Your Review', 'woocommerce') . '</label><textarea class="form-control" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>' . wp_nonce_field('woocommerce-comment_rating', '_wpnonce', true, false) . '</p>';
    pgl_comment_form(apply_filters('woocommerce_product_review_comment_form_args', $comment_form), 'btn-primary', 'submit-form');
    ?>
			</div>
		</div>

	<?php 
} else {
    ?>

		<p class="woocommerce-verification-required"><?php 
    _e('Only logged in customers who have purchased this product may leave a review.', 'woocommerce');
    ?>
</p>

	<?php 
}