disable ratings option. Closes #1503.

This commit is contained in:
Mike Jolley 2012-09-21 21:21:50 +01:00
parent 5fcfe948d7
commit e61c152a7c
3 changed files with 49 additions and 36 deletions

View File

@ -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.

View File

@ -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 = '';

View File

@ -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 : ?>