News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

allow rating to not registered users

Started by kiasati, July 29, 2018, 07:36:58 AM

Previous topic - Next topic

kiasati

Hi.

an old problem.
I want to let guests (not registered users) rate for a product.
for reviewing I am using jcomments, so that's been solved. the only problem is rating now.

so I added the code below to templates/template_name/html/com_virtuemart/productdetails/defaut_reviews.php

$this->showRating = true;
$this->allowRating = true;




problem number one:
now guests can see the rating form, but when they submit, their review won't submit.

When i checked _virtuemart_ratings table in the database, i saw that for every rate, the id for the user who has submitted the rate is needed.

what is the best and easiest way to solve this problem?



problem number two:
when i checked the table i realized that when i submit a rate with 2 different registered users, although the average rate on "rating" column changes and works fine, but "ratingcount" does not change and it stays on 1.
ratingcount is supposed to count the number of rates submitted by different users, but it won't increase. I think this is a bug in vm.



to Virtuemart team:
WAY WON'T YOU GUYS CHANGE THE REVIEW AND RATE SYSTEM AND LET US ALLOW GUESTS RATE AND REVIEW IN VM CONFIGURATION???!!!!!!


I am using VirtueMart 3.2.14 and Joomla 3.8.10

any help would be appreciated.
thanks.

Studio 42

The system only allow 1 rating and 1 review per product from same user id.
It's why guest rating is not working.

kiasati

Quote from: Studio 42 on July 29, 2018, 13:50:55 PM
The system only allow 1 rating and 1 review per product from same user id.
It's why guest rating is not working.
What do u mean?
I think your answering problem number 2,
I tested with 2 different registered users.

Studio 42

Answer for :
Quotethe id for the user who has submitted the rate is needed.
About the counter, i have checked in the DB for a customer dev and the counter is correct. So the problem is perhaps only for guest ?
But in general, the code is complex for a so little thing.
You have 3 tables :
ratings
rating_votes
rating_reviews
ratings is to save the total counter + average note
votes = vote
reviews = review comment

But you have sme field that are duplicate.
in rating_reviews
   var $review_rates                  = null;
   var $review_ratingcount            = null;
   var $review_rating               = null;
in ratings
   var $rates 
   var $ratingcount                  = 0;
   var $rating                     = 0;

i dont really know why

You should only have in table ratings fields :
rates, ratingcount, rating
And this fields should be removed in table rating_reviews :
review_rates, review_ratingcount, review_rating to prevent any mistakes

Another strange table entry is lastip
This ip is set in rating_reviews and in  rating_votes. It should be in main ratings table if the role is to prevent 2x votes
I had personally moved the ratingcount  and (average) rates in the product table.
I had change the last ip to user_ip, so user_ip can be used for guest ratings and votes.
But i'm not anymore a core dev, so wait for vm team

kiasati

Quote from: Studio 42 on July 29, 2018, 17:19:43 PM.
so wait for vm team
do you think that they fix this in future versions?

why there are such problems?
why after years of developing the tables aren't clean and making such little changes is too hard?

I am using VirtueMart for 3 years now and I have seen other problems too.
for example:
- in canonical URLs or routing system
- showing products that are in stock first in the category page. seems simple but there isn't any option to do so in the configuration
- making multi-step checkout problem, possible but hard and not clean
- rating system problem, modifying is hard or not possible. letting guests vote is a simple thing but not possible to do so in the configuration.
- and other simple things that I can't think of now

it makes me think about using another online store component...


Jörgen

If You say that it is easy to fix this problems, please suggest improvements. Well thought changes are welcome. VM is a complicated component with a big codebase, that needs a lot of attention. Good help i always welcome. If You want another component, You are free to choose, every shop has its own needs and it is not easy to please everyone.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Studio 42

Quote from: kiasati on July 30, 2018, 09:09:26 AM
Quote from: Studio 42 on July 29, 2018, 17:19:43 PM.
so wait for vm team
do you think that they fix this in future versions?
I'm not the team, but if you are the only one having this problem with ratings then you should try to pay a Gold member subscription, so you get priority for this problems.
About the other problems, other store component have they own problems, i dont know a perfect solution(and tested many).