Updated the function that gets the related products to remove any duplicates.