Author Topic: MOD to 1.0.9: Rating Stars 0 to 5 presented Left to Right  (Read 5989 times)

toivo

  • Beginner
  • *
  • Posts: 18
MOD to 1.0.9: Rating Stars 0 to 5 presented Left to Right
« on: June 13, 2007, 12:48:30 pm »
Hi,

While testing the customer reviews, I noticed that the points 0 to 5 and the corresponding stars are presented Right to Left.  Even though it would have been simpler to just change the text to say '5 to 0' to reflect the actual order of the ratings, I modified the class ps_reviews.php to display the radio buttons from Left to Right.

Should the order perhaps be a configuration option?

The diff file of modifications to ps_reviews.php is attached.

Regards,

[attachment cleanup by admin]
toivo
-------------------------
Suzhou, China

dagnome

  • Beginner
  • *
  • Posts: 26
Re: MOD to 1.0.9: Rating Stars 0 to 5 presented Left to Right
« Reply #1 on: August 17, 2007, 19:24:03 pm »
Thank you Toivo - this helped me locate the offending code..

Might I suggest a perhaps easier way of stating the changes to be made?

In the file: /administrator/components/com_viretuemart/classes/ps_reviews.php

starting at line 171, change the order of the star table entries so it reads as boldfaced below:

            <h4>". $VM_LANG->_PHPSHOP_WRITE_REVIEW ."</h4>
            <br />". $VM_LANG->_PHPSHOP_REVIEW_RATE ."
            <form method=\"post\" action=\"". URL ."index.php\" name=\"reviewForm\" id=\"reviewform\">
            <table cellpadding=\"5\" summary=\"".$VM_LANG->_PHPSHOP_REVIEW_RATE."\">
              <tr>
                <th id=\"null_stars\">
                   <label for=\"user_rating0\"><img alt=\"0 stars\" src=\"".IMAGEURL."stars/0.gif\" border=\"0\" /></label>
                </th>
                <th id=\"one_star\">
                   <label for=\"user_rating1\"><img alt=\"1 star\" src=\"".IMAGEURL."stars/1.gif\" border=\"0\" /></label>
                </th>
                <th id=\"two_stars\">
                   <label for=\"user_rating2\"><img alt=\"2 stars\" src=\"".IMAGEURL."stars/2.gif\" border=\"0\" /></label>
                </th>
                <th id=\"three_stars\">
                   <label for=\"user_rating3\"><img alt=\"3 stars\" src=\"".IMAGEURL."stars/3.gif\" border=\"0\" /></label>
                </th>
                <th id=\"four_stars\">
                   <label for=\"user_rating4\"><img alt=\"4 stars\" src=\"".IMAGEURL."stars/4.gif\" border=\"0\" /></label>
                </th>
                <th id=\"five_stars\">
                   <label for=\"user_rating5\"><img alt=\"5 stars\" src=\"".IMAGEURL."stars/5.gif\" border=\"0\" /></label>
                </th>
              </tr>
              <tr>
                <td headers=\"null_stars\" style=\"text-align:center;\">
                   <input type=\"radio\" id=\"user_rating0\" name=\"user_rating\" value=\"0\" />
                </td>
                <td headers=\"one_star\" style=\"text-align:center;\">
                   <input type=\"radio\" id=\"user_rating1\" name=\"user_rating\" value=\"1\" />
                </td>
                <td headers=\"two_stars\" style=\"text-align:center;\">
                   <input type=\"radio\" id=\"user_rating2\" name=\"user_rating\" value=\"2\" />
                </td>
                <td headers=\"three_stars\" style=\"text-align:center;\">
                   <input type=\"radio\" id=\"user_rating3\" name=\"user_rating\" value=\"3\" />
                </td>
                <td headers=\"four_stars\" style=\"text-align:center;\">
                   <input type=\"radio\" id=\"user_rating4\" name=\"user_rating\" value=\"4\" />
                </td>
                <td headers=\"five_stars\" style=\"text-align:center;\">
                  <input type=\"radio\" id=\"user_rating5\" name=\"user_rating\" value=\"5\" />
                </td>
              </tr>
            </table>


Hope this helps someone else...

toivo

  • Beginner
  • *
  • Posts: 18
Re: MOD to 1.0.9: Rating Stars 0 to 5 presented Left to Right
« Reply #2 on: August 22, 2007, 02:01:43 am »
Thanks for your feedback, Dagnome.   I have a couple of enhancements in the pipeline, and this time I need to spend a bit more time in presenting the changes.

Cheers,
Toivo
toivo
-------------------------
Suzhou, China

reemet16

  • Beginner
  • *
  • Posts: 8
Re: MOD to 1.0.9: Rating Stars 0 to 5 presented Left to Right
« Reply #3 on: July 28, 2011, 11:37:41 am »
I found this code from file /components/com_virtuemart/themes/default/templates/common/reviewform.tpl.php
Changed it there and it also worked fine.
Thank you!