given a product page, i need to retrieve the product url for another store.
I'm trying this solution:
Mage::getUrl('', array(
'_current' => true,
'_use_rewrite' => true,
'_secure' => true,
'_store' => 3,
'_store_to_url' => true
));
but the result is that just the base url is changed, while the url key is the same. The link of course is broken.
i can't use the url_rewrite model because if there is no record for a product it just returns the base url.
Any idea?
thanks
Best Answer
Since you don't have access to URLs from the URL rewrites you'll need to add a
setStoreId()
when loading the product. Note, it's faster to have a URL key and query it instead of loading up the entire product Model.Further reading: