I am trying to get the related products from a specific product using the function getRelatedProducts.
$relatedProductsArray = $productModel->getRelatedProducts();
if($relatedProductsArray && count($relatedProductsArray) > 0){
foreach($relatedProductsArray as $_relatedProduct){
...
}
}
It works when the related products are assigned directly to the product in the admin product details. However, when the related products are created from Related Products Rules, the function returns to me an empty array.
What is the right way to get the related products assigned to a product from a rule?