Freelancer required to modify default Opencart 2.3.0.2 code. I want to modify the sort by “Rating” selection on each Category page.
Required Functionality:
For each Category, some of my products have been rated multiple times by the same reviewers - for example Mr A, Mrs B and Miss C have all rated Product 1, Product 2, and Product 3.
In addition, Product 1 has also been rated by Mr D and Product 2 has also been rated by Mrs E. The above sequence results in the following ratings:
Product 1: Rating = 7 [Mr A-8, Mrs B-8 and Miss C-10, Mr D-2]
Product 2: Rating = 8 [Mr A-8, Mrs B-8 and Miss C-9, Mrs E-7]
Product 3: Rating = 9 [Mr A-9, Mrs B-9 and Miss C-9]
This leads to sort order "Rating (Highest)”= Product 3,2,1
Given how potentially misleading the above result could be, I want to sort by the average of common reviews (i.e. average score based on common reviews of A, B, C), which would result in sort order “Rating (Highest)”= Product 3, 1, 2.
This update should keep the "Rating" unchanged, but modify the standard sort order (i.e. the ranking) to reflect the average score from common reviews. I need this functionality to work seamlessly, i.e. regardless of the number of reviews, number of common reviews and the average rating, all products within each Category will be sorted based on standard Rating and common reviews > 3.
As an additional example, if Product 4: Rating = 10 (based on 2 reviews from other non-common reviewers), Product 4 would automatically rank #1 on sort “Ranking (Highest)” regardless. If Product 4: Rating = 9.67 (based on 6 reviews, where 2 reviews are from common reviewers with lower scores), Product 4 would still rank #1, because it only has 2 common reviews.