disable ratings option. Closes #1503.
This commit is contained in:
parent
5fcfe948d7
commit
e61c152a7c
|
@ -188,6 +188,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
|
|||
* Localization - Romanian update by silviu-bucsa.
|
||||
* Localization - Dutch updates by Ramoonus.
|
||||
* Localization - Localized shortcode button.
|
||||
* Many other minor fixes and tweaks!
|
||||
|
||||
= 1.6.5.2 - 12/09/2012 =
|
||||
* Tweak - Extra validation for PayPal IPN.
|
||||
|
|
|
@ -12,6 +12,8 @@ global $woocommerce;
|
|||
|
||||
echo '<div id="comments">';
|
||||
|
||||
if ( get_option('woocommerce_enable_review_rating') == 'yes' ) {
|
||||
|
||||
$count = $wpdb->get_var("
|
||||
SELECT COUNT(meta_value) FROM $wpdb->commentmeta
|
||||
LEFT JOIN $wpdb->comments ON $wpdb->commentmeta.comment_id = $wpdb->comments.comment_ID
|
||||
|
@ -29,7 +31,7 @@ global $woocommerce;
|
|||
AND comment_approved = '1'
|
||||
");
|
||||
|
||||
if ( $count > 0 ) :
|
||||
if ( $count > 0 ) {
|
||||
|
||||
$average = number_format($rating / $count, 2);
|
||||
|
||||
|
@ -41,11 +43,17 @@ global $woocommerce;
|
|||
|
||||
echo '</div>';
|
||||
|
||||
else :
|
||||
} else {
|
||||
|
||||
echo '<h2>'.__('Reviews', 'woocommerce').'</h2>';
|
||||
|
||||
endif;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
echo '<h2>'.__('Reviews', 'woocommerce').'</h2>';
|
||||
|
||||
}
|
||||
|
||||
$title_reply = '';
|
||||
|
||||
|
|
|
@ -18,10 +18,14 @@ global $post;
|
|||
|
||||
<div class="comment-text">
|
||||
|
||||
<?php if ( get_option('woocommerce_enable_review_rating') == 'yes' ) : ?>
|
||||
|
||||
<div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" class="star-rating" title="<?php echo esc_attr( get_comment_meta( $GLOBALS['comment']->comment_ID, 'rating', true ) ); ?>">
|
||||
<span style="width:<?php echo get_comment_meta( $GLOBALS['comment']->comment_ID, 'rating', true )*16; ?>px"><span itemprop="ratingValue"><?php echo get_comment_meta( $GLOBALS['comment']->comment_ID, 'rating', true ); ?></span> <?php _e('out of 5', 'woocommerce'); ?></span>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($GLOBALS['comment']->comment_approved == '0') : ?>
|
||||
<p class="meta"><em><?php _e('Your comment is awaiting approval', 'woocommerce'); ?></em></p>
|
||||
<?php else : ?>
|
||||
|
|
Loading…
Reference in New Issue