PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.9.2
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.9.2
4.9.2 4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / widgets / product-rating / screens / default.php
shopengine / widgets / product-rating / screens Last commit date
default.php 6 days ago
default.php
59 lines
1 <?php defined('ABSPATH') || exit;
2
3 global $product;
4 if(!$product){
5 return;
6 }
7
8 // return if review not available
9 $is_editor = ($post_type == \ShopEngine\Core\Template_Cpt::TYPE) ? true : false;
10 $rating_count = $product->get_rating_count();
11 $show_zero_reviews = isset($settings['shopengine_show_zero_reviews']) && $settings['shopengine_show_zero_reviews'] === 'yes';
12
13 if(!$is_editor && (!post_type_supports('product', 'comments') || !wc_review_ratings_enabled() || (!$show_zero_reviews && $rating_count <= 0) || !function_exists('woocommerce_template_single_rating'))) {
14 return;
15 }
16
17 \ShopEngine\Widgets\Widget_Helper::instance()->wc_template_filter_by_match('woocommerce/single-product/rating.php', 'templates/single-product/rating.php');
18
19 $shopengine_rating_singular_label = !empty($settings['shopengine_rating_singular_label']) ? $settings['shopengine_rating_singular_label'] : __('Customer Review', 'shopengine');
20 $shopengine_rating_plural_label = !empty($settings['shopengine_rating_plural_label']) ? $settings['shopengine_rating_plural_label'] : __('Customer Reviews', 'shopengine');
21
22 $rating_count = $product->get_rating_count();
23 $review_count = $product->get_review_count();
24 $average = $product->get_average_rating();
25 ?>
26
27 <div class="shopengine-product-rating">
28
29 <?php if($is_editor) : ?>
30
31 <div class="woocommerce-product-rating">
32 <?php shopengine_content_render( wc_get_rating_html( $average, $rating_count ) ); ?>
33 <a title="<?php esc_html_e('Product Reviews','shopengine')?>" href="#reviews" class="woocommerce-review-link" rel="nofollow">
34 (<?php shopengine_content_render(sprintf( _n( '%s '. $shopengine_rating_singular_label, '%s ' . $shopengine_rating_plural_label, $rating_count, 'shopengine' ), '<span class="count">' . esc_html( $review_count ) . '</span>' )); ?>)
35 </a>
36 </div>
37
38 <?php else :
39
40
41 if ( ! wc_review_ratings_enabled() ) {
42 return;
43 }
44
45 if ( $rating_count > 0 || ($show_zero_reviews && $rating_count <= 0) ) : ?>
46
47 <div class="woocommerce-product-rating">
48 <?php shopengine_content_render( wc_get_rating_html( $average, $rating_count ) ); ?>
49 <?php if ( comments_open() ) : ?>
50 <?php //phpcs:disable ?>
51 <a title="<?php esc_html_e('Product Reviews','shopengine')?>" href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s ' . $shopengine_rating_singular_label, '%s ' . $shopengine_rating_plural_label, $review_count, 'shopengine' ), '<span class="count">' . esc_html( $review_count ) . '</span>' ); ?>)</a>
52 <?php // phpcs:enable ?>
53 <?php endif ?>
54 </div>
55 <?php
56 endif;
57 endif;
58 ?>
59 </div>