danneh.org

Get website-level configuration in Magento

by on Dec.07, 2011, under Magento, PHP

I stumbled across this one a couple of times now, and it’s caught me out every time.

With Magento, you have the method Mage::getStoreConfig() to get a store-level config, but nothing obvious to get a website-level configuration (such as a default URL for the website).

So I used this;

Mage::app()->getWebsite($websiteId)->getConfig('web/unsecure/base_url')

It’s the same syntax as what’s used in Mage::getStoreConfig(), but uses getWebsite() instead of getStore(). Hopefully this won’t catch me out anymore!

:, , ,

2 Comments for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...