Like a “review” in Magento

Today I’ve created a “review” liking module in Magento so customers can read the reviews of a product and like (or dislike) any which they find useful. I based it on some code I found here:

http://sapnandu-magento.blogspot.co.uk/2012/06/create-review-like-module-in-magento.html#comment-form

I found the code a great place to start from, but found some problems with the login links, and I’m not sure how the data was being stored because it seemed to not have a 1 to 1 relationship between the review_like table and a particular review, but we’re interested in the total number of likes or dislikes. So I adapted things somewhat and seems to work great now.

I particularly like it because I’ve got the sorting on the review to show the most useful one first, and then it goes by most recent which I think will be very helpful for customers.