I have a custom module with adminhtml setting (system.xml), which allows the the user to assign a unique "code" to a specific shipping method.
It looks something like this:
As you can see, this is pretty basic as the requirement was only for 5 mapping. This was done like this using the system.xml like this:
<charge_1_method translate="label">
<label><![CDATA[Charge <b style="color: #FF7F24;">#1</b> Method]]></label>
<frontend_type>select</frontend_type>
<source_model>mymodule_adminhtml/system_config_source_dropdown_shippingmethods</source_model>
<sort_order>14</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</charge_1_method>
<charge_1_code translate="label">
<label><![CDATA[Charge <b style="color: #FF7F24;">#1</b> Code]]></label>
<frontend_type>text</frontend_type>
<sort_order>15</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</charge_1_code>
... etc
Now the requirement has changed, where I have to map around 25 different shipping methods to a unique code. So, I'd like to have this portion of the setting functioning dynamically.
So, user can create as many key ==> value pair matching as they want.
Key has to be the "shipping method" from my custom dropdown select source. Value has to be an input field.
Any idea on how I can achieve this? Are there any examples of this?