- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2017
02:54 AM
04-06-2017
02:54 AM
Showing a value in a custom module config page
Hello, i"ve been working on a custom module and i'm kind of stuck right now, basically when the module is installed it generates a token in the database and i would like to show the user that token in the config page.
here is my system.xml part that shows the field
<fields> <token_message> <label>Token</label> <frontend_type>text</frontend_type> <source_model> vendoflux/token </source_model> <sort_order>1</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </token_message> </fields>
i tried to send random data with the toOptionarray() function in my /model/token.php file but doesnt seem to work, any help would be appreciatedpublic function toOptionArray()
{ return array( array('value'=>1, 'label'=>Mage::helper('vendoflux')->__('Hello')), ); }
Labels:
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2017
01:00 AM
04-07-2017
01:00 AM
Re: Showing a value in a custom module config page
hi @mehdiG5
If you generating the code on installer script you can set values for configuration
$installer->setConfigData('tabsection/group/token_message','//you token values');
or do it directly
Mage::getConfig()->saveConfig('tabsection/group/token_message', '//you token values', 'default', 0);
Find helpful ? Consider Giving Kudos to this post.
Problem solved? Click Accept as Solution!"
Qaisar Satti
Problem solved? Click Accept as Solution!"
Qaisar Satti
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2017
11:18 AM
04-08-2017
11:18 AM
Re: Showing a value in a custom module config page
You should write value into database (core_config_data table), as said previous answer, or set value in default section of config
____________________________________________
Magento? it's really interesting.. BroSolutions like it
Magento? it's really interesting.. BroSolutions like it
