Product Reviews by Tess Breakdown Display

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lesliekirk
    Super Moderator











    • Aug 2008
    • 9296

    #1

    Product Reviews by Tess Breakdown Display

    Is there a way to change the Breakdown Display in the Reviews Template for the Product Reviews Version 2.012 module? Currently, it's displaying 1-5. I need it to be 5-1

    emuTXt.png

    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: X | Facebook | Pinterest
  • Nick
    Super Moderator











    • Dec 2011
    • 576

    #2
    lesliekirk that template is available in Settings > System Extension Settings > Product: Reviews Settings under the Reviews Template tab:

    reviews.png
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment

    • lesliekirk
      Super Moderator











      • Aug 2008
      • 9296

      #3
      Originally posted by Nick View Post
      lesliekirk that template is available in Settings > System Extension Settings > Product: Reviews Settings under the Reviews Template tab:

      reviews.png
      Yes, I know, but I don't quite see what controls the display order:

      Code:
      <mvt:foreach iterator="breakdown" array="tgr:breakdown">
      <mvt:assign name="l.settings:breakdown:percent" value="( l.settings:breakdown:count / l.settings:tgr:review_count ) * 100" />
      <div class="tgreviews-breakdown">
      <div class="tgreviews-breakdown__rating">
      <mvt:if expr="l.settings:breakdown:count GT 0">
      <span><a href="&mvte:tgr:link;?TGR_Sort=&mvta:global:TGR_So rt;&TGR_Show_Rating=&mvta:breakdown:rating;" title="View Reviews with a rating of &mvte:breakdown:rating;">&mvte:breakdown:rating ;</a></span>
      <mvt:else>
      <span>&mvte:breakdown:rating;</span>
      </mvt:if>
      <span class="tgreviews-breakdown__star"><span class="u-icon-star-full"></span></span>
      </div>
      <div class="tgreviews-breakdown__percent" title="&mvte:breakdown:count; Reviews out of &mvte:tgr:review_count; are rated &mvte:breakdown:rating;">
      <div class="tgreviews-breakdown__percentage">
      <div class="tgreviews-breakdown__percentage-overlay" style="width: &mvte:breakdown:percent;%;"></div>
      </div>
      </div>
      
      <div class="tgreviews-breakdown__count" title="&mvte:breakdown:count; Reviews out of &mvte:tgr:review_count; are rated &mvte:breakdown:rating;">
      &mvte:breakdown:count;
      </div>
      </div>
      </mvt:foreach>
      The link within this code will display a specific set of reviews if you click the star. I think I understand that this calculates the percentage:

      Code:
      <mvt:assign name="l.settings:breakdown:percent" value="( l.settings:breakdown:count / l.settings:tgr:review_count ) * 100" />
      I also see in the "Sort By", which is initially configured in the Review Settings > Default Sorting Method

      That made me wonder if something from that section of code could be used. That is when I figured I would post to the forum to see if anyone else had come up against this...
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: X | Facebook | Pinterest

      Comment

      • lesliekirk
        Super Moderator











        • Aug 2008
        • 9296

        #4
        Just an FYI - changing this

        FHdWVa.png
        did not change this

        CA3Ted.png
        Leslie Kirk
        Miva Certified Developer
        Miva Merchant Specialist since 1997
        Previously of Webs Your Way
        (aka Leslie Nord leslienord)

        Email me: [email protected]
        www.lesliekirk.com

        Follow me: X | Facebook | Pinterest

        Comment

        • Nick
          Super Moderator











          • Dec 2011
          • 576

          #5
          lesliekirk the variable l.settings:breakdown:rating within the foreach loop are the numbers 1-5. To reverse them you would just use the QuickSortArray MivaScript function before the foreach loop.

          Code:
          <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:tgr:breakdown, ':rating',-1)" />
          Putting that before the foreach loop will sort the ratings in reverse order.
          Nicholas Adkins
          Technical Training Specialist / Miva, Inc.
          [email protected]
          https://www.miva.com/mivalearn

          Comment

          • heatherwebdev
            Mivite

            • May 2017
            • 157

            #6
            add this to the style of the div that holds the breakdown elements

            HTML Code:
            style="display: flex; flex-direction: column-reverse;"

            Comment

            • lesliekirk
              Super Moderator











              • Aug 2008
              • 9296

              #7
              Originally posted by heatherwebdev View Post
              add this to the style of the div that holds the breakdown elements

              HTML Code:
              style="display: flex; flex-direction: column-reverse;"
              OMG!!! Thank you - so easy peasy - thank you!
              Leslie Kirk
              Miva Certified Developer
              Miva Merchant Specialist since 1997
              Previously of Webs Your Way
              (aka Leslie Nord leslienord)

              Email me: [email protected]
              www.lesliekirk.com

              Follow me: X | Facebook | Pinterest

              Comment

              Working...
              X