openfire Posted December 20, 2015 Posted December 20, 2015 I would like the ability to allow members to submit more than one review per item. The reason is that for some items, such as hotels and restaurants, people often visit more than once and conditions can change over time, warranting a new review by the same member. See Tripadvisor... They allow more than one review of the same hotel. Is there a simple way to override this limitation?
chilihead Posted December 20, 2015 Posted December 20, 2015 Something like that would be great. Or ability to update review (not edit), and under your original one is a new post and stars, and the post background can be a different color and say Updated, or similar. That and this would be great:
openfire Posted December 20, 2015 Author Posted December 20, 2015 OK, after digging around in the code, I think I've figured it out... This seems to remove the 1 review restriction: In Item.php find return $this->canCommentReview( 'review', $member ) and !$this->hasReviewed( $member ); Remove this part: and !$this->hasReviewed( $member ) So you are left with this: return $this->canCommentReview( 'review', $member ); That seems to work for me so far, but I'm no coder, so YMMV. Note that you may have to repeat this process every time you upgrade as the file may be written over. edit to add: In Pages->Templates->Display->reviews Find {{if !$record->hasReviewed()}}<hr class='ipsHr'>{{endif}} and change to <hr class='ipsHr'> ^That adds back in the spacer line for those who have already reviewed.
Adriano Faria Posted December 21, 2015 Posted December 21, 2015 22 hours ago, openfire said: OK, after digging around in the code, I think I've figured it out... This seems to remove the 1 review restriction: In Item.php find return $this->canCommentReview( 'review', $member ) and !$this->hasReviewed( $member ); Remove this part: and !$this->hasReviewed( $member ) So you are left with this: return $this->canCommentReview( 'review', $member ); That seems to work for me so far, but I'm no coder, so YMMV. Note that you may have to repeat this process every time you upgrade as the file may be written over. edit to add: In Pages->Templates->Display->reviews Find {{if !$record->hasReviewed()}}<hr class='ipsHr'>{{endif}} and change to <hr class='ipsHr'> ^That adds back in the spacer line for those who have already reviewed. I think it's easier if you extend via code hook the function system/Content/Item.php:hasReviewed() to return 0, thus you don't need to edit any file/template. Also this is global. You need to use a condition to grab only the app you want, like Downloads or Pages, etc.
Adriano Faria Posted December 21, 2015 Posted December 21, 2015 23 minutes ago, Adriano Faria said: thus you don't need to extend any file/template I mean, EDIT. Sorry.
openfire Posted December 21, 2015 Author Posted December 21, 2015 Thanks Adriano. That makes a lot more sense than editing the core files every update!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.