2

I would like to check which store id is currently active and show something is store id is for example 1

The code I have now is this:

<?php if (Mage::getModel('core/store')->load($storeId) == 9): ?>
//code here
<?php endif; ?>

But it always returns the if code, no matter what the store id is. I think the problem is in the "=="check. Could someone tell me what the correct syntax is?

Aduro
  • 47
  • 2
  • 7

2 Answers2

1

to get current store information use

 Mage::app()->getStore()->getStoreId();

this will explain more

how to get store information in Magento?

Community
  • 1
  • 1
1
<?php if (Mage::app()->getStore()->getStoreId() == 9): ?>

in your case

Alexis Pigeon
  • 7,423
  • 11
  • 39
  • 44
Rohan Patil
  • 1,865
  • 1
  • 23
  • 36