0

I have multistore magento with multi domains. I want to add store switcher in main menu in mobile view. But giving store1.com as href do not call customers session to get shared shopping cart between stores. What should i add after href="http://domain1.com" in static block that i use in mobile menu?

1

There are 3 possible store configurations:

  1. If your websites are located in one domain, but in different directories, e.g. "www.example.com/stores/store1" and "www.example.com/stores/store2" you can setup your "Cookie Path" to "/stores/" in System -> Configuration -> Web -> Session Cookie Management.

  2. If your websites are located in different sub-domains e.g. "store1.example.com" and "store2.example.com" you can setup "Cookie Domain" to ".example.com" in System -> Configuration -> Web -> Session Cookie Management.

  3. If you have different domains, in this case you can add session ID to the URL for another store. Use this construction "Mage::getModel('core/url')->addSessionParam()->getUrl('...')" to get the URL with session parameter.

After that your customers will be able to switch between multi-stores Magento websites without re-login. In other words, if customer will login in one Magento website, he will be able to see another multi-store Magento website using his first store account. But the cart will be different for each Magento website.

  • it'll grateful to you ,if you can accept my answer above. – Sintu Roy May 2 '15 at 6:26
  • In static block cant use php here is code I use in block for mobile but does not share shoping cart, no SID: <li class="menu-item menu-item-has-children menu-parent-item"> <a href="javascript:;">Stores</a> <ul> <li class="menu-item menu-item-has-children menu-parent-item"> <a class="level1" href="domain2"><span>domain2</span></a> </li> <li class="menu-item menu-item-has-children menu-parent-item"> <a class="level1" href="domain1.com/"><span>domain1</span></a> </li> – Eraj May 2 '15 at 6:32
  • you can write php code in a phtml file then call it in your static block like this : {{block type="core/template" template="path/to/template.phtml"}} – Sintu Roy May 2 '15 at 6:43
  • I am not good at codes please help me what exactly I can use in my case? – Eraj May 2 '15 at 6:48
  • I tried this, but no any success I want to put store switcher in main menu of mobile view{{block type="page/switch" name="store_switcher_top" as="store_switcher_top" template="page/switch/stores-top.phtml"}} – Eraj May 2 '15 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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