14

How do I figure out what my store view ID's are?

This is required when modifying tables within database.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
Efficient Trade Ltd
  • 295
  • 3
  • 5
  • 18

6 Answers6

21

Screenshot to illustrate Jevgeni Smirnov's answer:

enter image description here

As he said, you should go to System -> Manage Stores and click on needed store name in the right column.

Dmytro Zavalkin
  • 5,265
  • 1
  • 30
  • 34
8

When you click on the specific store in Manage stores in the URL bar there should be a parameter like store_id or something like that. This is your store id. Or when in Manage stores screen if you hover over store and the link might be displayed in the right(left) corner of your browser. In the url there is store_id param. This is the easiest I guess.

Or in database there is table: core_store.

Jevgeni Smirnov
  • 3,787
  • 5
  • 33
  • 50
7

Pragmatically you can get the website id, website name, store id, store name and store code like this:

<?php
echo "Website ID: " . Mage::app()->getWebsite()->getId() . "<br/>"; 
echo "Website Name: " . Mage::app()->getWebsite()->getName() . "<br/>"; 
echo "Store ID: " . Mage::app()->getStore()->getId() . "<br/>"; 
echo "Store Name: ".Mage::app()->getStore()->getName(). "<br/>";
echo "Store code: ". Mage::app()->getStore()->getCode()."<br/>";
?> 

Here is an example looping through all the websites and print all store id and store names you have set up in your Magento:

<?php
foreach (Mage::app()->getWebsites() as $website) {
    foreach ($website->getGroups() as $group) {
        $stores = $group->getStores();
        foreach ($stores as $store) {
            echo $store->getId() ." ".$store->getName()."<br/>";
        }
    }
}
?> 
pevik
  • 4,523
  • 3
  • 33
  • 44
s-hunter
  • 24,172
  • 16
  • 88
  • 130
6

To get store_id from store_code use:

echo Mage::app()->getStore('store_code')->getId();
michelem
  • 14,430
  • 5
  • 50
  • 66
5

Look into the core_store table in the database.

hakre
  • 193,403
  • 52
  • 435
  • 836
Hubert Perron
  • 3,022
  • 5
  • 34
  • 28
1

you should go to "System -> Manage Stores" and click on needed store view name in the right column. click/hover on this and check url you find store id under url after /store_id/

same as ----- system_store/editStore/store_id/1/key/

Kapil Gupta
  • 194
  • 5
  • 21