/*
Theme Name: v400
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/
add_filter( 'woocommerce_product_get_rating_html', 'loop_product_get_rating_html', 100, 3 );
function loop_product_get_rating_html( $html, $rating, $count ){
    if ( 0 < $rating && ! is_product() ) {
        global $product;
        $rating_cnt = array_sum($product->get_rating_counts());
        $count_html = ' <div class="count-rating">(' . $rating_cnt .')</div>';

        $html       = '<div class="container-rating"><div class="star-rating">';
        $html      .= wc_get_star_rating_html( $rating, $count );
        $html      .= '</div>' . $count_html . '</div>';
    }
    return $html;
}
function danhgia_Random(){ ?>
<div class="rate">
 <span class="point">4.2/5 <i class="icon-star"></i></span>
                <span class="total-rate"><?php echo rand(50, 295); // Hiển thị: -2 ?> đánh giá</span>
</div>

<?php 
} 
add_filter( 'woocommerce_after_shop_loop_item_title', 'danhgia_Random', 10, 3 );
add_shortcode( 'danhgia', 'danhgia_Random' );

@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/


}
