jolia
October 8, 2024, 10:02pm
1
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?
Matej
October 9, 2024, 4:55am
2
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
jolia
October 9, 2024, 8:54am
3
thank you @Matej .
Can I have a feature request for it? Is it possible to implement it? For example:
{woo_product_rating:floatval:value}
Matej
October 9, 2024, 9:55am
4
HI @jolia ,
this is a very specific feature 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
jolia
October 9, 2024, 10:11am
5
Done @Matej . I hope it will be approved for voting. thanks
1 Like