Related Items don't show Related Name & don't link

Hi all,

I have a very big project I am working on, so I will have different threads on this project concerning various issues.

This one is about the related items section.
I have had help with a WIX code expert to start but I am stuck.

The problem:
The repeater in my dynamic page can identify the number of related items the products have and shows the corect number of placeholders, but it doesn’t change the placeholders text to the related item’s name and it doesn’t add the link to the related product.

Here is what I have:

  1. Related Items Strip - Collapse on Load (if has data it will expand) - ‘stripRelated’
  2. Related Items Repeater with some placeholder items - ‘repeaterRelated’
  3. Products database - ‘products’
  4. Related items database with references - ‘related’
  5. The following code , created by the wix code expert plus some tests I made (i deleted most code that is not about the related items):
import wixData from 'wix-data';
import wixLocation from 'wix-location';

let measurements;
let product;

$w.onReady( function () {
  product =  $w('#dynamicDataset').getCurrentItem();
  setupMesurementsDDL();//for something else
  showRelatedItems();
  showExistingMedia();
});

//ignore: this is about something else
export function measurements_change(event) {
  $w('#price').text=event.target.value
}

async function showRelatedItems(){
 let result = await wixData.query('related').eq('prod',product._id).include('related').find();
 let related;
 if (result.items.length) {
    related = result.items[0].related;
    $w('#repeaterRelated').data = related;
    $w('#stripRelated').expand();
    $w('#relatedName').onClick(() => {
 wixLocation.to("https://mywebsite.com" + product.slug);
})
  }
}
export function repeaterRelated_itemReady($item, itemData, index) {
  $w('#relatedName').text = itemData.productName;
}

I spent hours trying to apply the examples in resources and the ones here in the forum without success.
Pleeeeease help me complete this task…

Thanks :slight_smile: