This is driving me crazy! The general/region/state_required
data from system->configuration cannot be retrieved by Mage::getStoreConfig()
function. In the database, this value is presented, and data persistence works OK as well, i.e. changing the value in the CMS will take the change the database. The following is a abstraction from system.xml
of Magento default Directory module.
<general>
<groups>
<country>
<fields>
<optional_zip_countries translate="label">
<label>Postal Code is Optional for the following countries</label>
<frontend_type>multiselect</frontend_type>
<sort_order>3</sort_order>
<source_model>adminhtml/system_config_source_country</source_model>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<can_be_empty>1</can_be_empty>
</optional_zip_countries>
</fields>
</country>
<region translate="label">
<label>States Options</label>
<frontend_type>text</frontend_type>
<sort_order>4</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<fields>
<state_required translate="label">
<label>State is required for</label>
<frontend_type>multiselect</frontend_type>
<source_model>adminhtml/system_config_source_country</source_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</state_required>
<display_all translate="label">
<label>Display not required State</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>8</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
</display_all>
</fields>
</region>
</groups>
</general>
In fact, general/region/display_all
returns null as well while it has a non-empty value. This is really weird, I have no idea about it now, can anyone please help?!
--Update--
Is it possible that this value is being overridden somewhere? Like some code hardcode this value to be null, it overrides the value in the db.
I tried a couple of methods suggested below, unfortunately they don't solve the problem here. Any more input from people?
system -> config
and not cms pages? – Jonathan Hussey Oct 27 '14 at 8:29