Get page URL from current page, different store-viewGet current category or current product and then get its url in the other store store viewget other store url on same pageHow to get HTML response of each multistore page?How can I get the correct product url based on store view?How to get the URL for the B2C website/storeview from a B2B website/storeview/product-pageMagento hreflang tags: How to get URL Key per Store View?hreflang tags for multiple websites?Translate Pages by store viewGetting URL for Products only works for first storeMagento2: Different domain for each store view1 Domain - 2 Stores - both of them in English and German - How to get Language Tag in URL?

99 coins into the sacks

Is the tensor product (of vector spaces) commutative?

Can I bring back Planetary Romance as a genre?

Are there vaccine ingredients which may not be disclosed ("hidden", "trade secret", or similar)?

Why did Ham the Chimp push levers?

Can the president of the United States be guilty of insider trading?

Which "exotic salt" can lower water's freezing point by 70 °C?

How to append code verbatim to .bashrc?

What's an appropriate age to involve kids in life changing decisions?

When was it publicly revealed that a KH-11 spy satellite took pictures of the first Shuttle flight?

Gift for mentor after his thesis defense?

What's the difference between "ricochet" and "bounce"?

Can a character shove an enemy who is already prone?

I want to write a blog post building upon someone else's paper, how can I properly cite/credit them?

I'm attempting to understand my 401k match and how much I need to contribute to maximize the match

My Sixteen Friendly Students

While drilling into kitchen wall, hit a wire - any advice?

How long can fsck take on a 30 TB volume?

How to explain intravenous drug abuse to a 6-year-old?

And now you see it II (the B side)

What will Doctor Strange protect now?

Magical Modulo Squares

Is it a good idea to copy a trader when investing?

How could a civilization detect tachyons?



Get page URL from current page, different store-view


Get current category or current product and then get its url in the other store store viewget other store url on same pageHow to get HTML response of each multistore page?How can I get the correct product url based on store view?How to get the URL for the B2C website/storeview from a B2B website/storeview/product-pageMagento hreflang tags: How to get URL Key per Store View?hreflang tags for multiple websites?Translate Pages by store viewGetting URL for Products only works for first storeMagento2: Different domain for each store view1 Domain - 2 Stores - both of them in English and German - How to get Language Tag in URL?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








6















I'm using different store-views to create different language versions of a shop. Now I'm trying to add links to the other pages. However, I can not find a way to get the actual URL from the other store, if the url of that page / product / category is changed for that store (in this case, translated). I've got the following code at this moment:



<?php
// Get the current website
$website = Mage::app()->getWebsite();
// Only get languages/stores from the current website
$stores = $website->getStores();
// loop through the stores
foreach ($stores as $_lang):
// If it's not the current store, create an alternative for it
if( $_lang->getId() != Mage::app()->getStore()->getStoreId() )
// Get the language code for that store view
$lang_code = substr(Mage::getStoreConfig('general/locale/code', $_lang->getId()),0,2);
// Create a link, using getCurrentUrl for the set store ?>
<link rel="alternate" hreflang="<?php echo $lang_code; ?>" href="<?php echo $_lang->getCurrentUrl(); ?>" />
<?php ?>
<?php endforeach; ?>


However, this returns the same URL, with a ?___store=fr&___from_store=nl at the end. It should however give the URL from the different store, which has a different url key.
I've also tried the following:



Mage::getUrl('', array(
'_current' => true,
'_use_rewrite' => true,
'_secure' => true,
'_store' => $_lang->getId(),
'_store_to_url' => true
));


But this gave the exact same results.



Is there a way to retrieve the right URL without having to use a redirect?










share|improve this question






























    6















    I'm using different store-views to create different language versions of a shop. Now I'm trying to add links to the other pages. However, I can not find a way to get the actual URL from the other store, if the url of that page / product / category is changed for that store (in this case, translated). I've got the following code at this moment:



    <?php
    // Get the current website
    $website = Mage::app()->getWebsite();
    // Only get languages/stores from the current website
    $stores = $website->getStores();
    // loop through the stores
    foreach ($stores as $_lang):
    // If it's not the current store, create an alternative for it
    if( $_lang->getId() != Mage::app()->getStore()->getStoreId() )
    // Get the language code for that store view
    $lang_code = substr(Mage::getStoreConfig('general/locale/code', $_lang->getId()),0,2);
    // Create a link, using getCurrentUrl for the set store ?>
    <link rel="alternate" hreflang="<?php echo $lang_code; ?>" href="<?php echo $_lang->getCurrentUrl(); ?>" />
    <?php ?>
    <?php endforeach; ?>


    However, this returns the same URL, with a ?___store=fr&___from_store=nl at the end. It should however give the URL from the different store, which has a different url key.
    I've also tried the following:



    Mage::getUrl('', array(
    '_current' => true,
    '_use_rewrite' => true,
    '_secure' => true,
    '_store' => $_lang->getId(),
    '_store_to_url' => true
    ));


    But this gave the exact same results.



    Is there a way to retrieve the right URL without having to use a redirect?










    share|improve this question


























      6












      6








      6








      I'm using different store-views to create different language versions of a shop. Now I'm trying to add links to the other pages. However, I can not find a way to get the actual URL from the other store, if the url of that page / product / category is changed for that store (in this case, translated). I've got the following code at this moment:



      <?php
      // Get the current website
      $website = Mage::app()->getWebsite();
      // Only get languages/stores from the current website
      $stores = $website->getStores();
      // loop through the stores
      foreach ($stores as $_lang):
      // If it's not the current store, create an alternative for it
      if( $_lang->getId() != Mage::app()->getStore()->getStoreId() )
      // Get the language code for that store view
      $lang_code = substr(Mage::getStoreConfig('general/locale/code', $_lang->getId()),0,2);
      // Create a link, using getCurrentUrl for the set store ?>
      <link rel="alternate" hreflang="<?php echo $lang_code; ?>" href="<?php echo $_lang->getCurrentUrl(); ?>" />
      <?php ?>
      <?php endforeach; ?>


      However, this returns the same URL, with a ?___store=fr&___from_store=nl at the end. It should however give the URL from the different store, which has a different url key.
      I've also tried the following:



      Mage::getUrl('', array(
      '_current' => true,
      '_use_rewrite' => true,
      '_secure' => true,
      '_store' => $_lang->getId(),
      '_store_to_url' => true
      ));


      But this gave the exact same results.



      Is there a way to retrieve the right URL without having to use a redirect?










      share|improve this question
















      I'm using different store-views to create different language versions of a shop. Now I'm trying to add links to the other pages. However, I can not find a way to get the actual URL from the other store, if the url of that page / product / category is changed for that store (in this case, translated). I've got the following code at this moment:



      <?php
      // Get the current website
      $website = Mage::app()->getWebsite();
      // Only get languages/stores from the current website
      $stores = $website->getStores();
      // loop through the stores
      foreach ($stores as $_lang):
      // If it's not the current store, create an alternative for it
      if( $_lang->getId() != Mage::app()->getStore()->getStoreId() )
      // Get the language code for that store view
      $lang_code = substr(Mage::getStoreConfig('general/locale/code', $_lang->getId()),0,2);
      // Create a link, using getCurrentUrl for the set store ?>
      <link rel="alternate" hreflang="<?php echo $lang_code; ?>" href="<?php echo $_lang->getCurrentUrl(); ?>" />
      <?php ?>
      <?php endforeach; ?>


      However, this returns the same URL, with a ?___store=fr&___from_store=nl at the end. It should however give the URL from the different store, which has a different url key.
      I've also tried the following:



      Mage::getUrl('', array(
      '_current' => true,
      '_use_rewrite' => true,
      '_secure' => true,
      '_store' => $_lang->getId(),
      '_store_to_url' => true
      ));


      But this gave the exact same results.



      Is there a way to retrieve the right URL without having to use a redirect?







      magento-1 multistore url store-view hreflang






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 17 '18 at 16:20









      sv3n

      10.1k62557




      10.1k62557










      asked Jun 22 '16 at 16:07









      Sander KoedoodSander Koedood

      3122414




      3122414




















          2 Answers
          2






          active

          oldest

          votes


















          0














          When accessing the alternate link which your code generates Magento should rewrite and redirect to the correct URL. You can take a look at Mage_Core_Model_Url_Rewrite_Request::_rewriteDb to see this rewrite process.



          Basically it maps the request path from the ___from_store scope to the ___store scope.



          You could mimic this rewrite process but I would advise against it. You would be performing a lot of database actions without knowing if the result will be used or not, and seeing that the 'ugly' URL is eventually redirect to the correct 'pretty' URL anyway, it doesn't seem to matter, especially if you're outputting these URL's in a non-visible way.



          Regards,
          Vincent






          share|improve this answer






























            0














            You have to create a Module/Helper like this one:




            app/code/local/Your/Rewrites/Helper/Data.php




            class Your_Rewrites_Helper_Data extends Mage_Core_Helper_Abstract

            public function rewrittenProductUrl($productId, $categoryId, $storeId)

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

            $coreUrl->setStoreId($storeId);
            $coreUrl->loadByIdPath($idPath);

            return $coreUrl->getRequestPath();


            public function rewrittenCategoryUrl($categoryId, $storeId)

            $coreUrl = Mage::getModel('core/url_rewrite');
            $idPath = sprintf('category/%d', $categoryId);
            $coreUrl->setStoreId($storeId);
            $coreUrl->loadByIdPath($idPath);

            return $coreUrl->getRequestPath();




            and




            etc/config.xml




            <?xml version="1.0" encoding="utf-8"?>
            <config>
            <modules>
            <Your_Rewrites>
            <version>1.0</version>
            </Your_Rewrites>
            </modules>
            <global>
            <helpers>
            <your_rewrites>
            <class>Your_Rewrites_Helper</class>
            </your_rewrites>
            </helpers>
            </global>
            </config>


            and call it from your languages.phtml which, I suppose you working with or in any other phtml with theses kind of lines



            $helper = Mage::helper('your_rewrites');
            $prod = Mage::registry('current_product');
            $categ = Mage::registry('current_category');
            $categId = $categ ? $categ->getId() : null;

            foreach ($this->getStores() as $_lang)
            if ($prod)
            $link[$_lang->getId()] = $_lang->getBaseUrl() . $helper->rewrittenProductUrl($prod->getId(), $categId, $_lang->getId());
            elseif ($categ)
            $link[$_lang->getId()] = $_lang->getBaseUrl() . $helper->rewrittenCategoryUrl($categId, $_lang->getId());
            else
            $link[$_lang->getId()] = $_lang->getCurrentUrl(false);




            This will basically get according links from other stores, for products, categories, and fallback if not product/catagory type & put them into a links array. Of course you have to change the end of that file to display the link as you wish to.



            Read more : This code is an adaptation of this Source






            share|improve this answer

























              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "479"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f122318%2fget-page-url-from-current-page-different-store-view%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              When accessing the alternate link which your code generates Magento should rewrite and redirect to the correct URL. You can take a look at Mage_Core_Model_Url_Rewrite_Request::_rewriteDb to see this rewrite process.



              Basically it maps the request path from the ___from_store scope to the ___store scope.



              You could mimic this rewrite process but I would advise against it. You would be performing a lot of database actions without knowing if the result will be used or not, and seeing that the 'ugly' URL is eventually redirect to the correct 'pretty' URL anyway, it doesn't seem to matter, especially if you're outputting these URL's in a non-visible way.



              Regards,
              Vincent






              share|improve this answer



























                0














                When accessing the alternate link which your code generates Magento should rewrite and redirect to the correct URL. You can take a look at Mage_Core_Model_Url_Rewrite_Request::_rewriteDb to see this rewrite process.



                Basically it maps the request path from the ___from_store scope to the ___store scope.



                You could mimic this rewrite process but I would advise against it. You would be performing a lot of database actions without knowing if the result will be used or not, and seeing that the 'ugly' URL is eventually redirect to the correct 'pretty' URL anyway, it doesn't seem to matter, especially if you're outputting these URL's in a non-visible way.



                Regards,
                Vincent






                share|improve this answer

























                  0












                  0








                  0







                  When accessing the alternate link which your code generates Magento should rewrite and redirect to the correct URL. You can take a look at Mage_Core_Model_Url_Rewrite_Request::_rewriteDb to see this rewrite process.



                  Basically it maps the request path from the ___from_store scope to the ___store scope.



                  You could mimic this rewrite process but I would advise against it. You would be performing a lot of database actions without knowing if the result will be used or not, and seeing that the 'ugly' URL is eventually redirect to the correct 'pretty' URL anyway, it doesn't seem to matter, especially if you're outputting these URL's in a non-visible way.



                  Regards,
                  Vincent






                  share|improve this answer













                  When accessing the alternate link which your code generates Magento should rewrite and redirect to the correct URL. You can take a look at Mage_Core_Model_Url_Rewrite_Request::_rewriteDb to see this rewrite process.



                  Basically it maps the request path from the ___from_store scope to the ___store scope.



                  You could mimic this rewrite process but I would advise against it. You would be performing a lot of database actions without knowing if the result will be used or not, and seeing that the 'ugly' URL is eventually redirect to the correct 'pretty' URL anyway, it doesn't seem to matter, especially if you're outputting these URL's in a non-visible way.



                  Regards,
                  Vincent







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 23 '16 at 10:51









                  Vincent HornikxVincent Hornikx

                  83138




                  83138























                      0














                      You have to create a Module/Helper like this one:




                      app/code/local/Your/Rewrites/Helper/Data.php




                      class Your_Rewrites_Helper_Data extends Mage_Core_Helper_Abstract

                      public function rewrittenProductUrl($productId, $categoryId, $storeId)

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

                      $coreUrl->setStoreId($storeId);
                      $coreUrl->loadByIdPath($idPath);

                      return $coreUrl->getRequestPath();


                      public function rewrittenCategoryUrl($categoryId, $storeId)

                      $coreUrl = Mage::getModel('core/url_rewrite');
                      $idPath = sprintf('category/%d', $categoryId);
                      $coreUrl->setStoreId($storeId);
                      $coreUrl->loadByIdPath($idPath);

                      return $coreUrl->getRequestPath();




                      and




                      etc/config.xml




                      <?xml version="1.0" encoding="utf-8"?>
                      <config>
                      <modules>
                      <Your_Rewrites>
                      <version>1.0</version>
                      </Your_Rewrites>
                      </modules>
                      <global>
                      <helpers>
                      <your_rewrites>
                      <class>Your_Rewrites_Helper</class>
                      </your_rewrites>
                      </helpers>
                      </global>
                      </config>


                      and call it from your languages.phtml which, I suppose you working with or in any other phtml with theses kind of lines



                      $helper = Mage::helper('your_rewrites');
                      $prod = Mage::registry('current_product');
                      $categ = Mage::registry('current_category');
                      $categId = $categ ? $categ->getId() : null;

                      foreach ($this->getStores() as $_lang)
                      if ($prod)
                      $link[$_lang->getId()] = $_lang->getBaseUrl() . $helper->rewrittenProductUrl($prod->getId(), $categId, $_lang->getId());
                      elseif ($categ)
                      $link[$_lang->getId()] = $_lang->getBaseUrl() . $helper->rewrittenCategoryUrl($categId, $_lang->getId());
                      else
                      $link[$_lang->getId()] = $_lang->getCurrentUrl(false);




                      This will basically get according links from other stores, for products, categories, and fallback if not product/catagory type & put them into a links array. Of course you have to change the end of that file to display the link as you wish to.



                      Read more : This code is an adaptation of this Source






                      share|improve this answer





























                        0














                        You have to create a Module/Helper like this one:




                        app/code/local/Your/Rewrites/Helper/Data.php




                        class Your_Rewrites_Helper_Data extends Mage_Core_Helper_Abstract

                        public function rewrittenProductUrl($productId, $categoryId, $storeId)

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

                        $coreUrl->setStoreId($storeId);
                        $coreUrl->loadByIdPath($idPath);

                        return $coreUrl->getRequestPath();


                        public function rewrittenCategoryUrl($categoryId, $storeId)

                        $coreUrl = Mage::getModel('core/url_rewrite');
                        $idPath = sprintf('category/%d', $categoryId);
                        $coreUrl->setStoreId($storeId);
                        $coreUrl->loadByIdPath($idPath);

                        return $coreUrl->getRequestPath();




                        and




                        etc/config.xml




                        <?xml version="1.0" encoding="utf-8"?>
                        <config>
                        <modules>
                        <Your_Rewrites>
                        <version>1.0</version>
                        </Your_Rewrites>
                        </modules>
                        <global>
                        <helpers>
                        <your_rewrites>
                        <class>Your_Rewrites_Helper</class>
                        </your_rewrites>
                        </helpers>
                        </global>
                        </config>


                        and call it from your languages.phtml which, I suppose you working with or in any other phtml with theses kind of lines



                        $helper = Mage::helper('your_rewrites');
                        $prod = Mage::registry('current_product');
                        $categ = Mage::registry('current_category');
                        $categId = $categ ? $categ->getId() : null;

                        foreach ($this->getStores() as $_lang)
                        if ($prod)
                        $link[$_lang->getId()] = $_lang->getBaseUrl() . $helper->rewrittenProductUrl($prod->getId(), $categId, $_lang->getId());
                        elseif ($categ)
                        $link[$_lang->getId()] = $_lang->getBaseUrl() . $helper->rewrittenCategoryUrl($categId, $_lang->getId());
                        else
                        $link[$_lang->getId()] = $_lang->getCurrentUrl(false);




                        This will basically get according links from other stores, for products, categories, and fallback if not product/catagory type & put them into a links array. Of course you have to change the end of that file to display the link as you wish to.



                        Read more : This code is an adaptation of this Source






                        share|improve this answer



























                          0












                          0








                          0







                          You have to create a Module/Helper like this one:




                          app/code/local/Your/Rewrites/Helper/Data.php




                          class Your_Rewrites_Helper_Data extends Mage_Core_Helper_Abstract

                          public function rewrittenProductUrl($productId, $categoryId, $storeId)

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

                          $coreUrl->setStoreId($storeId);
                          $coreUrl->loadByIdPath($idPath);

                          return $coreUrl->getRequestPath();


                          public function rewrittenCategoryUrl($categoryId, $storeId)

                          $coreUrl = Mage::getModel('core/url_rewrite');
                          $idPath = sprintf('category/%d', $categoryId);
                          $coreUrl->setStoreId($storeId);
                          $coreUrl->loadByIdPath($idPath);

                          return $coreUrl->getRequestPath();




                          and




                          etc/config.xml




                          <?xml version="1.0" encoding="utf-8"?>
                          <config>
                          <modules>
                          <Your_Rewrites>
                          <version>1.0</version>
                          </Your_Rewrites>
                          </modules>
                          <global>
                          <helpers>
                          <your_rewrites>
                          <class>Your_Rewrites_Helper</class>
                          </your_rewrites>
                          </helpers>
                          </global>
                          </config>


                          and call it from your languages.phtml which, I suppose you working with or in any other phtml with theses kind of lines



                          $helper = Mage::helper('your_rewrites');
                          $prod = Mage::registry('current_product');
                          $categ = Mage::registry('current_category');
                          $categId = $categ ? $categ->getId() : null;

                          foreach ($this->getStores() as $_lang)
                          if ($prod)
                          $link[$_lang->getId()] = $_lang->getBaseUrl() . $helper->rewrittenProductUrl($prod->getId(), $categId, $_lang->getId());
                          elseif ($categ)
                          $link[$_lang->getId()] = $_lang->getBaseUrl() . $helper->rewrittenCategoryUrl($categId, $_lang->getId());
                          else
                          $link[$_lang->getId()] = $_lang->getCurrentUrl(false);




                          This will basically get according links from other stores, for products, categories, and fallback if not product/catagory type & put them into a links array. Of course you have to change the end of that file to display the link as you wish to.



                          Read more : This code is an adaptation of this Source






                          share|improve this answer















                          You have to create a Module/Helper like this one:




                          app/code/local/Your/Rewrites/Helper/Data.php




                          class Your_Rewrites_Helper_Data extends Mage_Core_Helper_Abstract

                          public function rewrittenProductUrl($productId, $categoryId, $storeId)

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

                          $coreUrl->setStoreId($storeId);
                          $coreUrl->loadByIdPath($idPath);

                          return $coreUrl->getRequestPath();


                          public function rewrittenCategoryUrl($categoryId, $storeId)

                          $coreUrl = Mage::getModel('core/url_rewrite');
                          $idPath = sprintf('category/%d', $categoryId);
                          $coreUrl->setStoreId($storeId);
                          $coreUrl->loadByIdPath($idPath);

                          return $coreUrl->getRequestPath();




                          and




                          etc/config.xml




                          <?xml version="1.0" encoding="utf-8"?>
                          <config>
                          <modules>
                          <Your_Rewrites>
                          <version>1.0</version>
                          </Your_Rewrites>
                          </modules>
                          <global>
                          <helpers>
                          <your_rewrites>
                          <class>Your_Rewrites_Helper</class>
                          </your_rewrites>
                          </helpers>
                          </global>
                          </config>


                          and call it from your languages.phtml which, I suppose you working with or in any other phtml with theses kind of lines



                          $helper = Mage::helper('your_rewrites');
                          $prod = Mage::registry('current_product');
                          $categ = Mage::registry('current_category');
                          $categId = $categ ? $categ->getId() : null;

                          foreach ($this->getStores() as $_lang)
                          if ($prod)
                          $link[$_lang->getId()] = $_lang->getBaseUrl() . $helper->rewrittenProductUrl($prod->getId(), $categId, $_lang->getId());
                          elseif ($categ)
                          $link[$_lang->getId()] = $_lang->getBaseUrl() . $helper->rewrittenCategoryUrl($categId, $_lang->getId());
                          else
                          $link[$_lang->getId()] = $_lang->getCurrentUrl(false);




                          This will basically get according links from other stores, for products, categories, and fallback if not product/catagory type & put them into a links array. Of course you have to change the end of that file to display the link as you wish to.



                          Read more : This code is an adaptation of this Source







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Apr 17 '18 at 17:41









                          Rohan Hapani

                          1




                          1










                          answered Oct 5 '16 at 22:59









                          ffabffab

                          215




                          215



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Magento Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f122318%2fget-page-url-from-current-page-different-store-view%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                              Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                              Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?