Round rating points in Reviews

Posted in: Newspaper
Post count: 11

Hi Guys,

we are using the latest Newspaper V9.6.1.

In the past we were able to round the points to full numbers by editing the function “private static function render_table_footer” in td_review.php like that:


switch ($td_review['has_review']) {
case 'rate_point' :
$buffy .= '<div class="td-review-final-score">' . round(self::calculate_total($td_review)) . '</div>';
break;
}

Did that change after the last updates, because this not seems to work anymore. 🙂

Thanks in advance

Cheers,
Chris

Post count: 11

Maybe that would be a good feature to include with enabling/disabling by a simple checkbox. 😉

Post count: 23312

Hi,

Sorry for that but please notice that in the latest updated the theme core files were changed a bit and probably that’s why did not work, sorry! I have added to our list of improvements and probably we will include in our future updates.

Thank you!

Post count: 11

Hi Catalin,

Thanks for your answer, that made me investigate a bit deeper. 🙂
I think I found the right place in the td-cloud-library plugin within the shortcode tdb_single_review_overall.php.

$buffy .= '<div class="td-review-final-score">' . round($this->calculate_total($post_review_data)) . ($post_review_data['review_meta'] == 'rate_percent' ? ' %' : '') . '</div>';

Now, I have to search a way to hook into this single line to be safe in case of future updates. Maybe you have a idea? 🙂

Cheers,
Chris

Post count: 23312

Hi,

Unfortunately, this task involves doing such customization and we cannot provide this kind of services at the moment, sorry! As a hint, you should check the following useful guide from here -> https://digwp.com/2009/09/wordpress-action-hooks/ where is explained how you can create a hook in WordPress.

Thank you!

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.