@logan Thank you, I really appreciate the detailed instructions you’re sending. I’m sure others that are trying to implement these things will find it useful.
Just so it’s clear, this is what I’m referring to.
Thank you for replying Sarah, I tried with the integration but that’s for the reviews. What I’m trying to display is the star rating that usually goes close to the product title and description. Here’s an example.
Hi @oscarlora, thanks for clarifying! One way you could do this is by placing a text block within the native embed reviews wrapper layer, and binding the text to the code below:
H @oscarlora, you can select the text box you added and add a new binding in the data tab under “Element data bindings”. You can set the “Get” field to “Text”, select the “edit code” button in the “from” field, and then paste this code there.
//ratings could be a dynamic data object or an array
let itemsLen = state.reviews.length;
for(let i = 0; i < itemsLen; i++){
let rating_stars = [];
for(let j=0; j< parseInt(state.reviews[i].score); j++){
rating_stars[j] = state.star_img; // state.star_img can be a star image or any review.
}
state.reviews[i].score = rating_stars;
}
Let us know if you have any further questions. Thank you!