Jump to content

Crosshatch Half Star Error


Big Spender

Recommended Posts

Please make these edits in the Crosshatch template file content.product.php:

Was:
             {if $PRODUCT.review_score && $CTRL_REVIEW}
            <div class="rating">
             {for $i = 1; $i < 5; $i++}
                {if $product.review_score>= $i}
                <img src="{$STORE_URL}/skins/{$SKIN_FOLDER}/images/star.png" alt="" />
                {elseif $PRODUCT.review_score > ($i - 1) && $PRODUCT.review_score < $i}
                <img src="{$STORE_URL}/skins/{$SKIN_FOLDER}/images/star_half.png" alt="" />
                {else}
                <img src="{$STORE_URL}/skins/{$SKIN_FOLDER}/images/star_off.png" alt="" />
                {/if}
            {/for}
            </div>
 
Now:
            {if $PRODUCT.review_score && $CTRL_REVIEW}
            <div class="rating">
              {for $i=1 to 5}
                {if $PRODUCT.review_score gte $i}
                <img src="{$STORE_URL}/skins/{$SKIN_FOLDER}/images/star.png" alt="" />
                {elseif $PRODUCT.review_score gt ($i - 1) && $PRODUCT.review_score lt $i}
                <img src="{$STORE_URL}/skins/{$SKIN_FOLDER}/images/star_half.png" alt="" />
                {else}
                <img src="{$STORE_URL}/skins/{$SKIN_FOLDER}/images/star_off.png" alt="" />
                {/if}
              {/for}
            </div>

The second {if} has the wrong case for PRODUCT. Also, there are a few tweaks that use Smarty commands and syntax better.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...