Hi,
Here’s a solution:
In wp-product-review\inc\cwp_frontpage.php :
To fix the calculation of the average grade, line 74, replace:
if(!empty($option1_grade)) { $overall_score += $option1_grade; $iter++; }
if(!empty($option2_grade)) { $overall_score += $option2_grade; $iter++; }
if(!empty($option3_grade)) { $overall_score += $option3_grade; $iter++; }
if(!empty($option4_grade)) { $overall_score += $option4_grade; $iter++; }
if(!empty($option5_grade)) { $overall_score += $option5_grade; $iter++; }
with:
if(!empty($option1_grade)||$option1_grade==='0') { $overall_score += $option1_grade; $iter++; }
if(!empty($option2_grade)||$option2_grade==='0') { $overall_score += $option2_grade; $iter++; }
if(!empty($option3_grade)||$option3_grade==='0') { $overall_score += $option3_grade; $iter++; }
if(!empty($option4_grade)||$option4_grade==='0') { $overall_score += $option4_grade; $iter++; }
if(!empty($option5_grade)||$option5_grade==='0') { $overall_score += $option5_grade; $iter++; }
To fix the missing display of the “0” grades:
if (!empty($option1_content) && !empty($option1_grade) && strtoupper($option1_content) != 'DEFAULT FEATURE 1')
with:
if (!empty($option1_content) && (!empty($option1_grade)||$option1_grade==='0') && strtoupper($option1_content) != 'DEFAULT FEATURE 1')
if (!empty($option2_content) && !empty($option2_grade) && strtoupper($option2_content) != 'DEFAULT FEATURE 2')
with:
if (!empty($option2_content) && (!empty($option2_grade)||$option2_grade==='0') && strtoupper($option2_content) != 'DEFAULT FEATURE 2')
if (!empty($option3_content) && !empty($option3_grade)&& strtoupper($option3_content) != 'DEFAULT FEATURE 3')
with:
if (!empty($option3_content) && (!empty($option3_grade)||$option3_grade==='0')&& strtoupper($option3_content) != 'DEFAULT FEATURE 3')
if (!empty($option4_content) && !empty($option4_grade) && strtoupper($option4_content) != 'DEFAULT FEATURE 4')
with:
if (!empty($option4_content) && (!empty($option4_grade)||$option4_grade==='0') && strtoupper($option4_content) != 'DEFAULT FEATURE 4')
if (!empty($option5_content) && !empty($option5_grade) && strtoupper($option5_content) != 'DEFAULT FEATURE 5')
with:
if (!empty($option5_content) && (!empty($option5_grade)||$option5_grade==='0') && strtoupper($option5_content) != 'DEFAULT FEATURE 5')
I hope this will help.
Best regards