Ratings & Reviews /
Example Page Code
Example Page Code
Copy the page code below into your Product Display and Category Product List pages. See the sections below on placement into the product and category pages.
The g.reviews_show_more variable that is being references is active when someone clicks on the show more link in the stock setup. When that variable is active, 5 reviews are loaded instead of 2.
select
<mvt:if expr="g.reviews_show_more">
<mvt:item name="smr_reviews" param="load:5" />
<mvt:else>
<mvt:item name="smr_reviews" param="load:2" />
</mvt:if>
&mvt:smr_reviews:stars;
Displaying Product Reviews
Place the code above directly under this stock Miva Merchant code block in your Product Display Layout.
select
<div class="product-quantity">Quantity in Basket:
<mvt:if expr="l.settings:product:quantity EQ 0">
<span class="italic">None</span>
<mvt:else>
<span class="bold">&mvt:product:quantity;</span>
</mvt:if>
</div>
Code for the Category Product List Layout
Put the review code at the top of the screen into your Category Product List Layout page, directly under the following stock Miva Merchant code:
select
<div class="product-quantity">Quantity in Basket:
<mvt:if expr="l.settings:product:quantity EQ 0">
<span class="italic">none</span>
<mvt:else>
<span class="italic">&mvt:product:quantity;</span>
</mvt:if>
</div>
Note that sometimes in the stock Miva Merchant CSSUI setup, there isn't enough room for reviews to show in the category or other product listings. If this is the case, go into the SMR_REVIEW_CSS page template (click on pages in the left administration menu) where you'll find some comments about easily fixing that.
Displaying Custom Reviews
To display custom reviews, such as your checkout process, customer support, general overall feel goodness of your store, add the custom review code to the param section of the page item. In the example
below, I'm referencing a custom review item called checkout .
select
<mvt:if expr="g.reviews_show_more">
<mvt:item name="smr_reviews" param="load:5 checkout" />
<mvt:else>
<mvt:item name="smr_reviews" param="load:2 checkout" />
</mvt:if>
&mvt:smr_reviews:stars;
You don't have to create custom review items, all you do is put the code into the param area of the page item. Super easy.
updated April 12, 2013