I am setting up a Magento shop which has three languages:

  • DE (German)
  • EN (English)
  • JP (Japanese)

We have set up each language as a separate shop with different text/info etc in their appropriate languages.

We have also set up unique URL Keys so that the URLs are in their appropriate languages. The problem is, we need to link to products from another portion of the website which is run by Wordpress.

The issue we have, then, is that we can't seem to find a way to link to a product and have it display in its appropriate language as any full URL with the corresponding URL key will go only to that language/store view.





Is there any way to have a generic link to the product which will cause Magento to then see which store the user currently has set as default (in the 'store' cookie) and redirect accordingly?

  • Did you solve this?
    – tholu
    Commented Jul 22, 2015 at 14:05

2 Answers 2


The following approach might be not very SEO friendly but with different URL keys I don't see any SEO friendly one.

You can setup a proxy page like this:


require_once 'app/Mage.php';


$_product = Mage::getModel('catalog/product')->load((int)$_REQUEST['id']);
if ($_product->getId()) {
    header('Location: ' . $_product->getProductUrl());

Then in your WP you can just link to this file specifying product ID as _GET parameter.

  • This is not a good idea, best would be to get the correct url key for each language. However, this seems not to easy in Magento.
    – tholu
    Commented Jul 22, 2015 at 14:05
  • It is doable but will significantly increase page loading time. Commented Jul 22, 2015 at 18:27
  • It adds one database query for each language, which should not significantly increase page loading time. See my answer.
    – tholu
    Commented Jul 23, 2015 at 13:00
  • It will. Also just one language is very easy case. Commented Jul 23, 2015 at 16:31
  • If you can't afford one additional query per language, which will be very fast, you are doing something very wrong.
    – tholu
    Commented Jul 24, 2015 at 22:29

I found a solution here (needs to be adapted to work for categories and CMS pages as well): http://inchoo.net/magento/get-rewritten-product-url-in-a-different-store/

Basic idea is to use a function to get the rewritten URL for the product, category etc.:

function rewrittenProductUrl($productId, $categoryId, $storeId) {
        $coreUrl = Mage::getModel('core/url_rewrite');
        $idPath = sprintf('product/%d', $productId);
        if ($categoryId) {
            $idPath = sprintf('%s/%d', $idPath, $categoryId);

        return $coreUrl->getRequestPath();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.