Woocommerce 3.1.0 Compatability
This commit is contained in:
parent
05bd3a0606
commit
6d429df698
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* The template to display the reviewers star rating in reviews
|
* The template to display the reviewers star rating in reviews
|
||||||
* Updated for Understrap to maintain Woocommerce 3.0.3 compatability.
|
*
|
||||||
* This template can be overridden by copying it to yourtheme/woocommerce/content-product.php.
|
* This template can be overridden by copying it to yourtheme/woocommerce/review-rating.php.
|
||||||
*
|
*
|
||||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||||
* (the theme developer) will need to copy the new files to your theme to
|
* (the theme developer) will need to copy the new files to your theme to
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
* @see https://docs.woocommerce.com/document/template-structure/
|
* @see https://docs.woocommerce.com/document/template-structure/
|
||||||
* @author WooThemes
|
* @author WooThemes
|
||||||
* @package WooCommerce/Templates
|
* @package WooCommerce/Templates
|
||||||
* @version 3.0.0
|
* @version 3.1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) {
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
|
@ -23,13 +23,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||||
global $comment;
|
global $comment;
|
||||||
$rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) );
|
$rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) );
|
||||||
|
|
||||||
if ( $rating && get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) { ?>
|
if ( $rating && 'yes' === get_option( 'woocommerce_enable_review_rating' ) ) {
|
||||||
|
echo wc_get_rating_html( $rating );
|
||||||
<div class="star-rating">
|
}
|
||||||
<span style="width:<?php echo ( esc_attr( $rating ) / 5 ) * 100; ?>%"><?php
|
|
||||||
/* translators: %s: rating */
|
|
||||||
printf( esc_html__( '%s out of 5', 'understrap' ), '<strong>' . $rating . '</strong>' );
|
|
||||||
?></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php }
|
|
||||||
|
|
Reference in New Issue