WordPress.org

Ready to get started?Download WordPress

Forums

WP Customer Reviews
Make Submitting of Stars Optional (10 posts)

  1. acafella11
    Member
    Posted 2 years ago #

    Hi, love the plugin.

    I've removed the div for the stars (as I'm only looking for written reviews to be submitted. I went to test the form and noticed that it's still requiring that a star rating be given. How might I make this optional instead of mandatory? Looked all around the settings and didn't see it.

    Thanks.

    http://wordpress.org/extend/plugins/wp-customer-reviews/

  2. Demoris
    Member
    Posted 2 years ago #

    Hey there,

    You'll need to edit 2 files from what I can tell to remove the requirement for a star rating.

    1: open wp-customer-reviews.php and delete/comment out the lines from 1184 - 1186:

    if ($this->p->frating < 1 || $this->p->frating > 5) {
      $errors .= 'You have triggered our anti-spam system. Please try again. Code 003<br />';
    }

    2: open wp-customer-reviews.js and delete/comment out the lines from 87-89:

    if (frating < 1 || frating > 5) {
      err.push("Please select a star rating from 1 to 5.");
    }

    This will disable the requirement for leaving a star rating.

  3. alewis
    Member
    Posted 2 years ago #

    Hey Demoris - anything else that might need changing do you think? I've removed the coe you mentioned and am still required to enter a star rating.

    Acafella, any joy?

    Thanks.

  4. Demoris
    Member
    Posted 2 years ago #

    Alewis,

    Those are the lines I removed, and it worked for disabling the star rating requirement for me. Not sure what else could cause it, as these are the only area I found related to a star rating requirement.

  5. alewis
    Member
    Posted 2 years ago #

    Okay, thanks anyway Demoris. I had a look and couldn't find anything else either. More digging required it seems!

  6. mistamatrix
    Member
    Posted 2 years ago #

    Hi I just joined to say I've been looking at doing this today and followed Demoris instructions which for a start meant users are not required to give a star rating.

    I then removed the line.

    <td><label class="comment-field">Rating:</label></td>
                    <td><div class="wpcr_rating">' . $this->output_rating(0, true) . '</div></td>

    from wp-customer-reviews.php
    This removes the line of the form that asks for stars.

    I then deleted all references to the file 'newstars.png' in wp-customer-reviews.js
    This stopped the stars showing as 5 empty stars when the review is approved.

    I know this is butchery but it worked.

  7. Demoris
    Member
    Posted 2 years ago #

    Yes, sorry, that's correct. OP had already removed the div from the form, so I didn't add that to my post.

    Thanks for clearing that up mistamatrix.

  8. mistamatrix
    Member
    Posted 2 years ago #

    No problem, I just thought I'd give a bit more info since there are a few of us on this mission.

    Hope someone from gowebsolutions see's this and includes an option to turn off the stars from the settings as this kind of slapdash code butchery is not ideal.

    Thanks tho guys, I'm glad this came up since I only got asked to remove the stars this morning and it made me pull a face.

  9. alewis
    Member
    Posted 2 years ago #

    Oops. I completely forgot that the OP removed the div!

    Thanks for your help fellas (and Mistamatrix thanks for pointing out that references to the star.png need removing!)

  10. lenamtl
    Member
    Posted 1 year ago #

    This setting should be added in admin settings panel
    with other 'Fields to ask for on review form'

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic