magento set store id programmatically

前端 未结 3 600
一生所求
一生所求 2021-02-06 00:56

I am currently working on a magento site that is in 2 languages (French and Dutch). The approach I am taking is as follows:

  • Create a folder in the web root (named
3条回答
  •  佛祖请我去吃肉
    2021-02-06 01:50

    You will get all store details here

    getStores();
    foreach ($allStores as $_eachStoreId => $val) 
    {
    $_storeCode = Mage::app()->getStore($_eachStoreId)->getCode();
    $_storeName = Mage::app()->getStore($_eachStoreId)->getName();
    $_storeId = Mage::app()->getStore($_eachStoreId)->getId();
    echo $_storeId;
    echo $_storeCode;
    echo $_storeName;
    }
    ?>
    

    To redirect to the specified store, you need to redirect the page along with the store code.

    http://www.mywebsite.com/index.php/store_code/

    Please check the template/page/switch/stores.phtml for more details

提交回复
热议问题