I'm a beginner in Wix Code and I was wondering how I add more than 1 related products.
I checked the tutorials and my related products are working, but I only have one of them and I would love to have three related products.
Can someone tell me what I have to add?
// Find related products in the relationship collection by querying for related products in both relation directions. let relatedByTable = await Promise.all([ wixData.query('related-products') .eq('productA', productId) .include('productB') .find(), wixData.query('related-products') .eq('productB', productId) .include('productA') .find() ]); // Merge related products found from both sides of the relationship collection. let relatedProducts = [ ...relatedByTable.items.map(_ => _.productB), ...relatedByTable.items.map(_ => _.productA) ];