Drupal to Magento integration, simple link tweak with multilingual site

I see my coworker and friend Željko Prša made a nice little post on Adding a new language in Magento so I figure I’ll jump with a little Drupal to Magento integration trick concerning link issues and multilingual sites. Here is a piece of code you can use in your Drupal templates to do the proper switching from Drupal site to Magento while keeping the selected language of site. Note, this tweak assumes you have the desired language setup on both Drupal and Magento side.

This part goes to some of your Drupal theme file

global $language ;
$lname = ($language->language == null) ? 'en' : $language->language; /* like "en", "de" */
$storeView = null;
if($lname == 'de') { $storeView = '?___store=german&___from_store=english'; }
</p><p style="text-align: left;"><a id="main_menu_shop" href="<?php echo 'http://'.$_SERVER['HTTP_HOST'].base_path() ?>shop/index.php/someProductLink.html< ?php echo $storeView ?>">Shop</a>

Note the $storeView variable; GET ___store holds the value of code name of the view you assigned in Magento, while GET ___from_store variable is used as helper to Magento inner workings. You can basically omit the other one. Your links to Shop from Drupal to Magento should now activate the proper language, the same one you have active on Drupal side.

You made it all the way down here so you must enjoyed this post! You may also like:

How Inchoo developed Morris 4x4 Center Jan 29, 2018

How we developed a new Morris 4×4 Center store – case study

/ Leave a comment
Jan 18, 2018

Magento 2 Product Quick View

/ Leave a comment
Oct 18, 2017

Solr and Magento – search by department

/ Leave a comment


  1. Nice tips. I have a question. Is it possible to mix Drupal and Magento in one web site? I want to show my CMS part in Drupal but the store part in Magento.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.