For my shipping module, I have created a block which has group of form element.
<options translate="label">
<label>Other Settings</label>
<frontend_model>Namespace_Module_Block_Form_Field_Options</frontend_model>
<sort_order>172</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<can_be_empty>1</can_be_empty>
</options>
And this is block which I have created.
class Namespace_Module_Block_Form_Field_Options extends Mage_Adminhtml_Block_System_Config_Form_Field {
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
$value = Mage::getStoreConfig('carriers/namespace_module/optionalfield');
$xhtml = '<input type="text" class="input-text" value="'.$value.'" name="groups[namespace_module][fields][optionalfield][value]" />';
return $xhtml;
}
}
In this block I have create more many options, It is working fine. But the issue is that in system->configuration
,
Mage::getStoreConfig('carriers/namespace_module/optionalfield');
is returning value which is saved in default config, And not showing value according to the store selected.
In each store Mage::getStoreConfig('carriers/namespace_module/optionalfield');
is showing value which is saved in default config.
So I think I use this code Mage::getStoreConfig('carriers/namespace_module/optionalfield',$store_id)
than it will show me values according to store selected in system->configuration
.
So guide me how to get store id in this block