NO BUG: Problem in displaying rating value

Browser: Chrome (new)
OS: macOS / Windows / Linux / etc.

Hi bricks team.

I am trying to display the rating value using {woo_product_rating:value}. The problem is that the values ​​are displayed with two decimal places. For example, 4.50, while like all similar examples, 4.5 should be displayed.

Is this problem solvable?

Hi,

I’ll mark this as a no-bug, because it’s not really a bug, but a way it works.

The way you can solve it is that you use Code element and use this part of the code:

<?php
  echo floatval("{woo_product_rating:value}");
?>

This should give you 3.5 instead of 3,50 as a rating. Do not forget to sign the code and enable “Parse dynamic data”.


Matej

thank you @Matej.

Can I have a feature request for it? Is it possible to implement it? For example:

{woo_product_rating:floatval:value}

HI @jolia,

this is a very specific feature :slight_smile: I suggest you add it to the idea board (describe it when it will be used and so on), and we will review it.

Thank you,
Matej

Done @Matej . I hope it will be approved for voting. thanks

1 Like