This adds new section under system->configuration->Customers with name \"Shipping restrictions\” with group \"Customer groups\” in which it makes 3 fields. With source model i filled them.
But, i need to create fields dynamically depending on one or another condition. ( For example, create as many multiselect fields, as there are enabled shipping methods )
Is there any way I can do that? My guess is that it\’s done with Blocks, but i\’m not sure. Maybe there are some tutorials? I couldn\’t find any in google.
<depends/> allows you specify that your configuration field should only be displayed when another confgiruation field in the same group has a specific value.
For example, the Paypal Express System Configuration has the following select defined.
has a value of “1”, then the <specificcountry> field should be displayed. This happens instantly via some behind the scenes Javascript.
While it appears to work with any fields that send out on onchange event, the core Magento system only uses this function where the parent field is a select. If you’re paranoid about forward compatibility, I’d apply the same restriction to your own System Configuration fields, as it’s hard to tell where the core Magento team may take this feature in the future.
<depends/> allows you specify that your configuration field should only be displayed when another confgiruation field in the same group has a specific value.
For example, the Paypal Express System Configuration has the following select defined.
has a value of “1”, then the <specificcountry> field should be displayed. This happens instantly via some behind the scenes Javascript.
While it appears to work with any fields that send out on onchange event, the core Magento system only uses this function where the parent field is a select. If you’re paranoid about forward compatibility, I’d apply the same restriction to your own System Configuration fields, as it’s hard to tell where the core Magento team may take this feature in the future.
I dont think this will work in my situation, because as I understood from this tutorial, ill have to make so many multiselects as there are shipping methods and then point this <depends> to every multiselect for every method.
Maybe this will be clearer - I need to make multiselects with customer groups and <label> for multiselect should be shipping methods title. So, for every enabled shipping method there should be multiselect field with customer groups, where <label> will be shipping method. With enabled shipping method i mean methods, which are enabled in system->configuration->sales->shipping methods