HEX
Server: Apache
System: Linux webm020.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: bohousj (181416)
PHP: 8.4.22
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/bohousj/medal/wp-content/themes/choicy/inc/woocommerce/woo-rating.php
<?php

/**
 * [choicy_woo_rating description]
 * @return [type] [description]
 */
function choicy_product_details_rating(){
    global $product;
    $rating = $product->get_average_rating();
    $rating_count = $product->get_review_count();
    $html = '';
    $html .= '<div class="shop-detail_rating">';
    for ($i = 0; $i <= 4; $i++) {
        if ($i < floor($rating)) {
            $html .= '<span class="fas fa-star"></span>';
        } else {
            $html .= '<span class="fal fa-star"></span>';
        }
    }
    $html .= '
        <i class="tx-ratingText">( ' . $rating_count . ' Customar Review )</i>';
    $html .= '</div>';
    print choicy_product_details_rating_render($html);
}

function choicy_product_details_rating_render($html){
    return $html;
}

function choicy_woo_rating_for_shop(){
    global $product;
    $rating = $product->get_average_rating();
    $rating_count = $product->get_review_count();
    $html = '';
    $html .= '<div class="choicy-rating-wrapper rating">';
    for ($i = 0; $i <= 4; $i++) {
        if ($i < floor($rating)) {
            $html .= '<i class="fa fa-star"></i> ';
        } else {
            $html .= '<i class="light fa fa-star"></i>';
        }
    }
    $html .= '</div>';
    print choicy_woo_rating_for_shop_html($html);
}

function choicy_woo_rating_for_shop_html($html){
    return $html;
}

/**
 * [choicy_woo_rating description]
 * @return [type] [description]
 */
function choicy_woo_shop_rating()
{
    global $product;
    $rating = $product->get_average_rating();
    $review = esc_html('' . $rating . ' review');
    ob_start(); ?>
    <div class="choicy-rating-wrapper choicy-rating-wrapper__details">
        <?php
        for ($i = 0; $i <= 4; $i++) {
            if ($i < floor($rating)) { ?>
                <i class="fas fa-star"></i>
                <?php
            } else { ?>
                <i class="far fa-star"></i>
                <?php
            }
        }
        ?>
    </div>
    <?php
    return ob_get_clean();
}