Miva Merchant Development by Scot's Scripts

Scot's Scripts FAQs and Module Support

If you don't find the answers here contact us.
Documentation and support for our Miva modules is found here. If you can't find the answer you're looking for contact us and we'll add the information.
Does Google actually understand your Miva Merchant store? Our JSON-LD schema generator makes sure it does. Contact us to get started. (more info)

Ratings & Reviews / Template: Stars Display

Template: Stars Display

Stars Display Template

This template contains everything for the star ratings and reviews.

Updates

Dec 23, 2013

Multiple bug fixes. This template works with version 1.2 of the module.

<mvt:comment> v1.2  ----------------------------------------
The easiest way to use this is to put the following two lines somewhere in your product page:
<mvt:item name="smr_reviews" param="load" />
&mvt:smr_reviews:stars;
The first line loads the star data (including the default number of reviews and the review input data), the second line displays it.
-------------------------------------------- </mvt:comment>
<div class="rv-padding-top">
<mvt:comment> --------------- reminder email rating ---------------- </mvt:comment>
<mvt:if expr="g.rvoid">
  <div class="rv-padding-top rv-padding-bottom">
    <b>Thank you for rating this product!</b>
    <br />
    <span class="rv-font-smaller">Please sign in to leave a review or change your rating.</span>
  </div>
</mvt:if>
<mvt:comment> ------------------------ A thank you message after a review has been left. ------------------------ </mvt:comment>
<mvt:if expr="g.review_saved">
  <div class="rv-padding-top rv-padding-bottom">
    <b>Thank you for reviewing this product!</b>
    <mvt:if expr="g.smr_review_approval">
      <br />
      <b>Your review will be visible after administration approval.</b>
    </mvt:if>
  </div>
</mvt:if>
<mvt:comment> ------------------ A thank you message after a star rating has been left. ------------------ </mvt:comment>
<mvt:if expr="l.settings:smr_reviews:vote_recorded AND NOT g.rvoid">
  <div class="rv-padding-top rv-padding-bottom">
    <b>Thank you for rating this product!</b>
  </div>
</mvt:if>
<mvt:if expr="l.settings:smr_reviews:reviews_rated EQ 1">
  <div class="rv-float-left rv-padding-right">My rating:</div>
</mvt:if>
<mvt:comment> ----------------- the stars ----------------------- </mvt:comment>
<div class="rv-float-left rv-padding-right">
  <mvt:if expr="l.settings:smr_reviews:can_review OR g.email_rvoid">
    <ul class="smr_rating &mvt:smr_reviews:reviews_num_stars;">
     <li class="smr_one"><a href="&mvte:smr_reviews:reviews_star_vote_url;&smr_reviews_set=1" title="1 Star">1</a></li>
     <li class="smr_two"><a href="&mvte:smr_reviews:reviews_star_vote_url;&smr_reviews_set=2" title="2 Stars">2</a></li>
     <li class="smr_three"><a href="&mvte:smr_reviews:reviews_star_vote_url;&smr_reviews_set=3" title="3 Stars">3</a></li>
     <li class="smr_four"><a href="&mvte:smr_reviews:reviews_star_vote_url;&smr_reviews_set=4" title="4 Stars">4</a></li>
     <li class="smr_five"><a href="&mvte:smr_reviews:reviews_star_vote_url;&smr_reviews_set=5" title="5 Stars">5</a></li>
    </ul>
  <mvt:else>
    <ul class="smr_rating &mvt:smr_reviews:reviews_num_stars;">
     <li class="smr_one"></li>
     <li class="smr_two"></li>
     <li class="smr_three"></li>
     <li class="smr_four"></li>
     <li class="smr_five"></li>
    </ul>
  </mvt:if>
</div>
<mvt:comment> ---------------- leave/edit review link, also sign in link if necessary ----------------- </mvt:comment>
<div class="rv-float-left rv-font-smaller">
  <mvt:if expr="l.settings:smr_reviews:can_review">
  <mvt:if expr="l.settings:smr_reviews:email_tracking AND g.rvemail">
    <mvt:if expr="NOT l.settings:smr_reviews:review_done">
      <mvt:if expr="NOT g.smr_leave_review">
        <a href="&mvt:smr_reviews:review_link_url;&smr_leave_review=1">leave review</a>
      </mvt:if>
    <mvt:else>
      <mvt:if expr="NOT g.smr_edit_review">
        <a href="&mvt:smr_reviews:review_link_url;&smr_edit_review=1">edit your review</a>
      </mvt:if>
    </mvt:if>
  </mvt:if>
  </mvt:if>
  <mvt:if expr="l.settings:smr_reviews:email_tracking AND NOT g.rvemail">
    <a href="&mvte:global:secure_sessionurl;screen=LOGN&store_code=&mvte:global:store_code;&product_code=&mvte:global:product_code&amp;category_code=&mvte:global:category_code;">sign in to review</a>
  </mvt:if>
</div>
<div class="rv-clear"></div>
<mvt:comment> --------------- average star rating text ------------------ </mvt:comment>
<div class="rv-float-left rv-font-smaller">
  <mvt:if expr="l.settings:smr_reviews:reviews_total_votes">
    <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
      <mvt:if expr="l.settings:smr_reviews:reviews_total_votes EQ 1">
        (average out of <span itemprop="reviewCount">&mvt:smr_reviews:reviews_total_votes;</span> vote: <span itemprop="ratingValue">&mvt:smr_reviews:reviews_average_score;</span> stars)
      </mvt:if>
      <mvt:if expr="l.settings:smr_reviews:reviews_total_votes GT 1">
        (average out of <span itemprop="reviewCount">&mvt:smr_reviews:reviews_total_votes;</span> votes: <span itemprop="ratingValue">&mvt:smr_reviews:reviews_average_score;</span> stars)
      </mvt:if>
    </span>
  <mvt:else>
    &nbsp; <i>(not yet rated)</i>
  </mvt:if>
</div>
<div class="rv-clear rv-padding-top"></div>
<mvt:comment> --------------------- we show reviews or show the review input box, not both -------------------- </mvt:comment>
<mvt:if expr="g.smr_edit_review OR g.smr_leave_review">
<mvt:comment> ----------------- show the input box ------------------- </mvt:comment>
  <mvt:if expr="l.settings:smr_reviews:can_review">
    <div>
      <form  method="post" action="&mvt:smr_reviews:review_form_url;">
      <div class="rv-float-left">
        <mvt:if expr="g.smr_leave_review EQ 1">
          <b>Leave a Review</b>
        <mvt:elseif expr="g.smr_edit_review EQ 1">
          <b>Edit Your Review</b>
        </mvt:if>
      </div>
      <div class="rv-clear"></div>
      <div class="rv-float-left">
        <mvt:if expr="g.smr_leave_review EQ 1">
          <p>
            Name: <input type="text" name="smr_review_name" value="&mvte:smr_Reviews:review:name;">
          </p>
          <textarea name="smr_review_text" class="rv-input"></textarea>
        <mvt:elseif expr="g.smr_edit_review EQ 1">
          <textarea name="smr_review_text" class="rv-input">&mvte:smr_reviews:review:review;</textarea>
        </mvt:if>
        <br />
        <input type="submit" value="Save Review">
        <mvt:if expr="g.smr_review_approval">
          <br>
          <span class="rv-font-smaller">(your review will be visible after administration approval)</class>
        </mvt:if>
      </div>
      <div class="rv-clear"></div>
      <mvt:if expr="g.email_rvoid AND g.email_rvadded">
        <input type="hidden" name="email_rvoid" value="&mvte:global:email_rvoid;">
        <input type="hidden" name="email_rvadded" value="&mvte:global:email_rvadded;">
      </mvt:if>
      </form>
    </div>
  <mvt:else>
    <div><p>Please sign in first.</p></div>
  </mvt:if>
<mvt:else>
<mvt:comment> ---------------- show the review list -------------------- </mvt:comment>
  <mvt:if expr="l.settings:smr_reviews:review_list">
    <h3>Customer Reviews</h3>
    <mvt:foreach iterator="review" array="smr_reviews:review_list">
      <div itemprop="review" itemscope itemtype="http://schema.org/Review">
          <div class="rv-float-left rv-padding-right">
            <mvt:if expr="l.settings:review:stars">
              <ul class="smr_rating &mvt:review:reviews_num_stars;">
            <mvt:else>
             <ul class="smr_rating smr_nostar">
            </mvt:if>
              <li class="smr_one"></li>
              <li class="smr_two"></li>
              <li class="smr_three"></li>
              <li class="smr_four"></li>
              <li class="smr_five"></li>
            </ul>
            <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
              <span itemprop="ratingValue" content="&mvt:review:stars;"></span>
            </div>
          </div>
        <div class="rv-float-left" itemprop="datePublished">
          <small>
          reviewed: &mvt:review:date:month;/&mvt:review:date:day;/&mvt:review:date:year;
          <mvt:if expr="l.settings:review:review_name">
            <span itemprop="author">by &mvte:review:review_name;</span>
          </mvt:if>
          </small>
        </div>
        <div class="rv-clear rv-padding-bottom"></div>
        <mvt:if expr="l.settings:review:title">
  	      <div>
            <p><b>&mvte:review:title;</b></p>
          </div>
        </mvt:if>
        <div itemprop="description">
          <div>&mvte:review:review_text;</div>
        </div>
        <mvt:if expr="l.settings:review:pros">
          <div>
            <p>
             	<b>Pros:</b>
             	<br>
            	&mvte:review:pros;
            </p>
         </div>
       </mvt:if>
 	     <mvt:if expr="l.settings:review:cons">
         <div>
           <p>
           <b>Cons:</b>
           <br>
           &mvte:review:cons;
           </p>
         </div>
       </mvt:if>
      <br>
    </div>
  </mvt:foreach>
    <div class="rv-prevnext">
      <mvt:if expr="l.settings:smr_reviews:rv_prev">
        <div class="rv-float-left">
          <a href="&mvte:global:sessionurl;screen=&mvte:global:screen;&store_code=&mvte:global:store_code;&rv_pos=&mvte:global:rv_pos;&rv_prev=1&rv_product_code=&mvte:global:rv_product_code;&reviews_show_more=&mvte:global:reviews_show_more;"><b>&laquo;</b> prev page</a>
        </div>
      </mvt:if>
      <mvt:if expr="l.settings:smr_reviews:rv_next">
        <div class="rv-float-right">
          <a href="&mvte:global:sessionurl;screen=&mvte:global:screen;&store_code=&mvte:global:store_code;&rv_pos=&mvte:global:rv_pos;&rv_next=1&rv_product_code=&mvte:global:rv_product_code;&product_code=&mvte:global:product_code;&reviews_show_more=&mvte:global:reviews_show_more;">next page <b>&raquo;</b></a>
        </div>
      </mvt:if>
      <mvt:if expr="l.settings:smr_reviews:rv_next OR l.settings:smr_reviews:rv_prev AND NOT g.reviews_show_more">
        <div class="rv-text-center">
          <a href="&mvte:global:sessionurl;screen=&mvte:global:screen;&store_code=&mvte:global:store_code;&reviews_show_more=1&rv_pos=&mvte:global:rv_pos;&rv_product_code=&mvte:global:rv_product_code;&product_code=&mvte:global:product_code;&">- show more -</a>
        </div>
      </mvt:if>
    </div>
      <div class="clear"></div>
  </mvt:if>
</mvt:if>
</div>
updated December 23, 2013