Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a scenario where i need to be able to select magento stores like this from the system configuration section . Store view

Thanks in advance for any kind of help.

share|improve this question
up vote 4 down vote accepted

This goes in the system.xml under the fields tag.

<field_name_here translate="title" module="[module]">
    <label>Label goes here</label>
    <sort_order>10</sort_order> <!-- feel free to change this value -->
    <show_in_default>1</show_in_default><!-- can be 0 or 1 -->
    <show_in_website>0</show_in_website><!-- can be 0 or 1 -->
    <show_in_store>0</show_in_store><!-- can be 0 or 1 -->

Then create the source model.
For that you need a class inside your module.

app/code/[codebool]/[Namespace]/[Module]/Model/Store.php with this code:

class [Namespace]_[Module]_Model_Store {
    public function toOptionArray() {
        return Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true);

Replace in the code above the values between [] with the appropriate values and you are done.

share|improve this answer
Thanks a lot, it works like a charm. Thanks again. – Haris Aug 25 '14 at 8:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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