hi everyone
i have almost got the reviews working,
i have a boolean on the review for, recommend, yes or no.
i am displaying this on my reviews, it works but then when i press my load more button it doesn’t repeat this onready function.
i dont really know what im doing, im new to this.
any help appreictaed.
cheers
//-------------Data Setup -------------//
// Perform some setup when the dataset filter was completed.
export function showReviews() {
// If at least one review has been submitted:
if ($w( ‘#Reviews’ ).getTotalCount() > 0 ) {
// Expand the strip that displays the reviews.
$w( ‘#reviewsStrip’ ).expand();
// If there are no reviews:
} else {
// Collapse the strip that displays the reviews.
$w( ‘#reviewsStrip’ ).collapse(); //otherwise, hide it
}
}
// Set the action that occurs when a user clicks the “Load More” text.
export function resultsPages_click(event, $w) {
// Load additional reviews into the reviews repeater.
$w( ‘#Reviews’ ).loadMore();
}
$w.onReady( function () {
$w( ‘#Reviews’ ).onReady( () => {
$w( ‘#reviewsRepeater’ ).forEachItem(($w, itemData, index) => {
if (itemData.recommends){
$w( ‘#recommendation’ ).text = “I Recommend This Product” ;
}
else {
$w( ‘#recommendation’ ).text = “I Dont’ Recommend This Product” ;
}
} );
} );
} );