snipt

Ctrl+h for KB shortcuts

PHP

Magento: display store id

1
2
3
4
<?php

// display store ID
echo "Store ID = " . Mage::app()->getStore()->getStoreId();
https://snipt.net/embed/9be96dfa336e0098f48770d1e3264fa8/
/raw/9be96dfa336e0098f48770d1e3264fa8/
9be96dfa336e0098f48770d1e3264fa8
php
PHP
4
2019-07-14T16:52:16
True
False
False
/api/public/snipt/21744/
magento-display-store-id
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c1">// display store ID</span> </span><span id="L-4"><a name="L-4"></a><span class="k">echo</span> <span class="s2">&quot;Store ID = &quot;</span> <span class="o">.</span> <span class="nx">Mage</span><span class="o">::</span><span class="na">app</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">getStore</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">getStoreId</span><span class="p">();</span> </span></pre></div> </td></tr></table>
magento