Ribbons in the repeater (Store)

Hi there,
I currently have a product gallery. I used repeaters to which I connected the store database. But I can’t customize the ribbons. I see them in the database. I have a field name. Is it even possible?

This code works (for product name)

$w("#repeaterProducts").onItemReady(($item, itemData, index) => {
   const repeatedText = $item("#text");
   repeatedText.text = itemData.name;
});

This code doesn’t work (for ribbons)

$w("#repeaterProducts").onItemReady(($item, itemData, index) => {
   const repeatedText = $item("#text");
   repeatedText.text = itemData.ribbons;
});

I see an error ↓
Wix code SDK error: The text parameter that is passed to the text method cannot be set to the value . It must be of type string.

Is there a way to use ribbons?
#Store #Shop #Ribbons #Products #Repeater

Hi Eugene,

If you have indeed assigned a ribbon for a store item, the way to access it in the onItemReady is the following: itemData.ribbons[0].text. Otherwise, this line will return an error. Presumably, ribbons was made an array in the itemData object because there was some thought to allow multiple ribbons for a store product, but currently, it looks like you can assign only one.

Hi, thanks! It works.