0

I Have Multi website site. when site open first time in browser that time show a popup. popup have Website stores url.

so want if any customer click (website store 1) then he will see only website store 1 not store 2.

if customer type store 2 url manually then also redirect at store 1.

Please Suggest Me.

  • Have you use any extension? – Murtuza Zabuawala Sep 13 '16 at 5:23
  • No, I didn't use any Extension !!! – SURENDER SINGH Sep 13 '16 at 5:46
  • I want do this without extension any Idea ? – SURENDER SINGH Sep 13 '16 at 5:47
0

Here is my solution, maybe it will work.

After customer choose store to display, save the store code to session

$cookie = Mage::getSingleton('core/cookie');
$cookie->set('store_code', $storeCode, time() + 86400, '/');

In index.php add this code right before line Mage::run($mageRunCode, $mageRunType);:

Mage::app();
if($cookie->get('store_code')){
    $mageRunCode = $cookie->get('store_code');
}
Mage::reset();

This will redirect customer to the store that he chose before.

0

Try storing data in session

$url = Mage::getBaseUrl();// Your website Or $url = 'www.google.com'; // Any random url

    Mage::getSingleton('core/session')->setMySession($websiteUrl); //This will set data in the session
    $var = Mage::getSingleton('core/session')->getMySession(); //This will retrive data from session

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.