3

How could I get all active domains of current Magento Store? For active store view I can use:

$this->getRequest()->getHttpHost()

which gives me "www.example.com". But I wan't an array of all Magento store domains without leading http:// and / at the end.

Thanks!

1 Answer 1

6
$stores = Mage::app()->getStores();
foreach ($stores as $store)
{
    echo parse_url($store->getBaseUrl(), PHP_URL_HOST);
}
1
  • @iztok I just saw you do not want to have http:// etc, so I updated my post.
    – mpaepper
    Commented Jul 3, 2014 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.