{block name='productdetails-rating'}
    {if $stars > 0}
        {if isset($total) && $total > 1}
            {lang key='averageProductRating' section='product rating' assign='ratingLabelText'}
        {else}
            {lang key='productRating' section='product rating' assign='ratingLabelText'}
        {/if}
        {block name='productdetails-rating-main'}
        {if isset($link)}
            <a class="rating" href="{$link}#tab-votes" title="{$ratingLabelText}: {$stars}/5" aria-label="{lang key='Votes'}"{if !empty($tplscope) && $tplscope === 'list'} tabindex="-1"{/if}>
        {else}
            <span class="rating" title="{$ratingLabelText}: {$stars}/5">
        {/if}
        {strip}
            {if $stars >= 5}
                <i class="{et_getIcon key="rating"}"></i><i class="{et_getIcon key="rating"}"></i><i class="{et_getIcon key="rating"}"></i><i class="{et_getIcon key="rating"}"></i><i class="{et_getIcon key="rating"}"></i>
            {elseif $stars >= 4}
                <i class="{et_getIcon key="rating"}"></i><i class="{et_getIcon key="rating"}"></i><i class="{et_getIcon key="rating"}"></i><i class="{et_getIcon key="rating"}"></i>
                {if $stars > 4}
                    <i class="{et_getIcon key="ratingHalf"}"></i>
                {else}
                    <i class="{et_getIcon key="ratingEmpty"}"></i>
                {/if}
            {elseif $stars >= 3}
                <i class="{et_getIcon key="rating"}"></i><i class="{et_getIcon key="rating"}"></i><i class="{et_getIcon key="rating"}"></i>
                {if $stars > 3}
                    <i class="{et_getIcon key="ratingHalf"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i>
                {else}
                    <i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i>
                {/if}
            {elseif $stars >= 2}
                <i class="{et_getIcon key="rating"}"></i><i class="{et_getIcon key="rating"}"></i>
                {if $stars > 2}
                    <i class="{et_getIcon key="ratingHalf"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i>
                {else}
                    <i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i>
                {/if}
            {elseif $stars >= 1}
                <i class="{et_getIcon key="rating"}"></i>
                {if $stars > 1}
                    <i class="{et_getIcon key="ratingHalf"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i>
                {else}
                    <i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i>
                {/if}
            {elseif $stars > 0}
                <i class="{et_getIcon key="ratingHalf"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i><i class="{et_getIcon key="ratingEmpty"}"></i>
            {/if}
        {/strip}

        {if isset($link)}
            </a>
        {else}
            </span>
        {/if}
        {/block}
    {/if}
{/block}
