I am trying to find a way to hide the space of the trustpilot-widget if no reviews exist for the spesific product (id). Either with php or javascript or jquery. Maybe anyone have done something similar?
I have tried to read and filter the contene with php and curl, but calling the url to trustpilot iframe url just gives me the same content either there are reviews or not.
Not sure if you have already managed to resolve the issue. Here's something I found on their forum/support.
Apparently you can pass on the attribute
to hide the empty spaces if the Trustpilot product has no review.
This solution didn't fully resolve the issue I was having, as the above attribute will collapse the widget section but doesn't render default no review message or custom no review message, hopefully it will resolve your issue.
Here's the link to the above attribute
https://support.trustpilot.com/hc/en-us/community/posts/11186232962066-How-to-Hide-Trustpilot-widget-in-React-if-there-are-no-reviews-exist