I've been trying to get correct product urls for orders. By that I mean that when an order is created, i want to get the product url which will correspond to the store in which the order was made.
At first I've been using the
getProductUrl() but this method sometime returned to me urls with admin path.
My second try was using the following code:
However, sometimes I get invalid urls.
What is the correct way to get a valid product url for each order, which will correspond to the correct store?