0

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

1 Answer 1

1

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.

6
  • duplicating the original one including JavaScript part, give some shadow on this Commented Jan 27, 2016 at 9:56
  • Sorry what does "give some shadow on this" means ? Do you need more details on how to do that ? Commented Jan 27, 2016 at 10:00
  • yes, the details of how to duplicate the region/state pair configuration and modifying javascript Commented Jan 27, 2016 at 10:03
  • OK no problem I update my answer Commented Jan 27, 2016 at 10:18
  • So do i need to copy and replace with regiond_id as region_id1 and country_id as country_id1 and using the same elements region_id1 & country_id1 in system.xml? Commented Jan 27, 2016 at 10:37

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.