Question

How to get multiple Region/State in Configuration in the same tab.

`<region_id translate="label">
                            <label>Region/State</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>20</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>0</show_in_store>
                        </region_id>`


I have tried above code in two different groups and same field, but for the first field its showing dropdown at the time entering values and after saving its showing as textbox. Second group field working normally.

Note: both are same country(US) Region/States.

Please help me on how to maintain two Region/State in fields in same tab in system->Configuration

Was it helpful?

Solution

Please take a look at this answer here it gives you a hint about how it work : https://stackoverflow.com/a/6373364/3531064

The restriction of one pair to a page is a bit of a roadblock. I am writing my own source instead

I think you have to make your own pair configuration, duplicating the original one including JavaScript part.


I am looking on a 1.12 EE but this is probably similar to other versions.

In app/design/adminhtml/default/default/template/system/config/js.phtml
If you take a look around line 80 you have a class called originModel.
In this class Magento is updating region_id field with country_id base on configuration nodes name directly <country_id translate="label"> and <region_id translate="label"> and the configuration inputs with CSS class counties set with <frontend_class>countries</frontend_class>
I suggest you to take a look how it work here with this element that you can duplicate this.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top