Viewing 1 replies (of 1 total)
  • Thread Starter webdev00

    (@webdev00)

    I found out how to solve my issue.

    I edited the get_product_rating_html function at line 1499 in class.yith-woocommerce-advanced-reviews.php in /wp-content/plugins/yith-essential-kit-for-woocommerce-advanced-reviews :

    public function get_product_rating_html ( $rating_html, $rating ) {
                global $product;
                $rating_html = '';
    
                $rating = $this->get_average_rating ( $product->id );
                $noreview = '';
                if ( ICL_LANGUAGE_CODE=='en' ){ $noreview = "No reviews yet";}
                else { $noreview = "Pas encore d'avis";}
    
                if ( $rating > 0 ) {
    
                    $rating_html = '<div class="star-rating" title="' . sprintf ( __ ( 'Rated %s out of 5', 'yith-woocommerce-advanced-reviews' ), $rating ) . '">';
    
                    $rating_html .= '<span style="width:' . ( ( $rating / 5 ) * 100 ) . '%"><strong class="rating">' . $rating . '</strong> ' . __ ( 'out of 5', 'yith-woocommerce-advanced-reviews' ) . '</span>';
    
                    $rating_html .= '</div>';
                }else{
                    $rating_html = '<div>'.$noreview.'</div>';
                }
    
                return $rating_html;
            }

    now it shows up necessarily and I have it translated depending on the language.

    I also added :

    .grid4 .star-rating{
        margin: 0!important;
    }
    .star-rating{
        margin: 0!important;
    }

    to my CSS file in order for the two cases to occupy the same screen space and for everything to be lined up.

Viewing 1 replies (of 1 total)
  • The topic ‘make review stars visible always’ is closed to new replies.