For each product in the cart I'm loading its related products.
$related_product_collection = $_product->getRelatedProductCollection()
->addUrlRewrite()
->AddStoreFilter();
But I'm getting the URL of these related products without the category name
<?php echo $relatedProduct->getProductUrl(); ?>
I'm getting
http://myDomain/product1 instead of http://myDomain/categ1/product1
The courses can belong to several categories.
What's the best approach here? Add a rewrite manually? http://myDomain/product1 --> redirects to --> http://myDomain/cat1/product1
Add a loop through all the categories to get the right one for that related product?
Thanks in advance!