| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template variables: |
| 4 |
* |
| 5 |
* @var $controllers array settings as array |
| 6 |
* @var $content string |
| 7 |
*/ |
| 8 |
|
| 9 |
// Do not allow directly accessing this file. |
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit( 'This script cannot be accessed directly.' ); |
| 12 |
} |
| 13 |
|
| 14 |
use RadiusTheme\SB\Helpers\Fns; |
| 15 |
|
| 16 |
global $product; |
| 17 |
if ( empty( $product ) ) { |
| 18 |
return; |
| 19 |
} |
| 20 |
|
| 21 |
if ( ! wc_review_ratings_enabled() ) { |
| 22 |
return; |
| 23 |
} |
| 24 |
|
| 25 |
$rating_count = $product->get_rating_count(); |
| 26 |
$review_count = $product->get_review_count(); |
| 27 |
$average = $product->get_average_rating(); |
| 28 |
?> |
| 29 |
<div class="rtsb-product-rating"> |
| 30 |
<div class="woocommerce-product-rating"> |
| 31 |
<?php Fns::print_html( wc_get_rating_html( $average, $rating_count ) ); ?> |
| 32 |
<?php if ( comments_open() ) : ?> |
| 33 |
<?php //phpcs:disable ?> |
| 34 |
<a href="#comments" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s customer review', '%s customer reviews', $review_count, 'shopbuilder' ), '<span class="count">' . esc_html( $review_count ) . '</span>' ); ?>)</a> |
| 35 |
<?php // phpcs:enable ?> |
| 36 |
<?php endif ?> |
| 37 |
</div> |
| 38 |
</div> |
| 39 |
|