To Get the Magento backend Value
###To add a field in backend and to get the backend value in magento###
Step1: If you want to add any custom field goto the etc/system.xml file of that module and add it.(you can just copy paste the any block and change the name of that block)
Step2: Now your copied field will display on the backend,place some value and save it.
Step3: Now search Your assign value in the data base,you will find the value in core_config_data
example: I have placed the input value as 42721212
database in core_config_data table:
cloudzoom/general/zoom_width 42721212
Step 4: To get the value use helper,Search the helper model in the file
and use getCfg() to get the value
here
$h=Mage::getStoreConfig('cloudzoom/general/zoom_width ',Mage::app()->getStore());
or
$h=Mage::getStoreConfig('cloudzoom/general/zoom_width');
echo $h;
Step1: If you want to add any custom field goto the etc/system.xml file of that module and add it.(you can just copy paste the any block and change the name of that block)
Step2: Now your copied field will display on the backend,place some value and save it.
Step3: Now search Your assign value in the data base,you will find the value in core_config_data
example: I have placed the input value as 42721212
database in core_config_data table:
cloudzoom/general/zoom_width 42721212
Step 4: To get the value use helper,Search the helper model in the file
and use getCfg() to get the value
here
$h=Mage::getStoreConfig('cloudzoom/general/zoom_width ',Mage::app()->getStore());
or
$h=Mage::getStoreConfig('cloudzoom/general/zoom_width');
echo $h;
Comments
Post a Comment