Author Topic: allow rating to not registered users  (Read 464 times)

kiasati

  • Jr. Member
  • **
  • Posts: 103
    • JoomlaJoy
allow rating to not registered users
« on: July 29, 2018, 07:36:58 am »
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
Code: [Select]
$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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3673
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: allow rating to not registered users
« Reply #1 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.

kiasati

  • Jr. Member
  • **
  • Posts: 103
    • JoomlaJoy
Re: allow rating to not registered users
« Reply #2 on: July 29, 2018, 16:41:27 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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3673
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: allow rating to not registered users
« Reply #3 on: July 29, 2018, 17:19:43 pm »
Answer for :
Quote
the 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

  • Jr. Member
  • **
  • Posts: 103
    • JoomlaJoy
Re: allow rating to not registered users
« Reply #4 on: July 30, 2018, 09:09:26 am »
.
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

  • Global Moderator
  • Full Member
  • *
  • Posts: 1969
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: allow rating to not registered users
« Reply #5 on: July 30, 2018, 09:58:49 am »
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.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3673
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: allow rating to not registered users
« Reply #6 on: July 30, 2018, 13:54:42 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).