Trying to read the text contents of a div

topolino65
New Member
4 0 0

I am trying to check if a div contains the default text, if no reviews have been left. I want to change the text to something else. Trying to use the following code but without success as it wont save. Can anyone offer any help or advice. I should add this is an app, so I can't edit the CSS directly hence using this approach. The conditional {%if%} {%endif%} is necessary to prevent the code from over-ruling the other default message that appears if there IS a review, which I don't want to change.

 

<script>
var myDiv = document.getElementById("epr-review-here")

 

{% if var content = myDiv.innerHTML="Be The First Person To Review" %}
.epr-review .epr-data .epr-review-here {
visibility: hidden !important;
position: relative;
}
.epr-review .epr-data .epr-review-here:after {
position: absolute;
left: 0;
visibility: visible !important;
color: #666;
white-space: nowrap;
content: `Be The First To Review This Product` !important;
}
{% endif %}
</script>

Replies 4 (4)

Dan-From-Ryviu
Shopify Partner
7820 1519 1539

Hi @topolino65 

I guess it must have an option to translate text from that review app.

- Helpful? Like and Accept solution.
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Enjoy 1 month of Shopify for $1. Sign up now.

topolino65
New Member
4 0 0

No there isn't an option for that

Dan-From-Ryviu
Shopify Partner
7820 1519 1539

Could you send me your store link to check?

- Helpful? Like and Accept solution.
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Enjoy 1 month of Shopify for $1. Sign up now.

topolino65
New Member
4 0 0