14
votes
Accepted
How to get store config inside a theme template
I suggest you create your own block, which will extend the Magento\Framework\View\Element\Template class.
As the Magento\Framework\App\Config\ScopeConfigInterface is part of Magento\Framework\View\...
14
votes
Get config value for specific store from admin area
=> For Magento 1.9 :
Get Store Id :
Mage::app()->getStore()->getStoreId();
Get Config Value :
$configValue = Mage::getStoreConfig('sectionName/groupName/fieldName');
as per store vise :
$...
12
votes
Accepted
Magento 2: Get admin config values
First of all, the system config admin in Magento 2 has a separate system.xml config. It is put under etc/adminhtml/system.xml
Second, If you want to get the custom value. You need to use \Magento\...
10
votes
dynamic key => value pair adminhtml setting for custom module
So, user can create as many key ==> value pair matching as they want.
For this I would recommend the "Array" frontend and backend models, which work similar to the tier price definition in products. ...
10
votes
Accepted
How is the start page of System Configuration (admin/system_config/index) defined?
This depends on the sort_order of the sections in the system.xml, some extensions put very low value on this making their "important" configuration open instead the "General" page
10
votes
Accepted
system.xml dependencies across groups/fieldsets
After consulting the appropriate core file a cross group/fieldset <depends> looks like this:
<!-- … -->
<hello_message>
<label>Message</label>
<frontend_type&...
9
votes
Accepted
Role resource tree not displaying in magento2
After long research, I am able to resolve this problem.
A mistake was in the format of XML .
Initial code :
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
9
votes
How is the start page of System Configuration (admin/system_config/index) defined?
Thanks to Zifius' answer I wrapped my head around it.
Many modules make this mistake when adding a configuration group to an existing section (here: adding "orderexport" to "advanced > admin"):
<...
9
votes
Accepted
Magento 2 : How to check multiple if config in layout?
ifconfig supports only one value.
In order to solve your problem, I suggest creating your own block that extends Magento\Framework\View\Element\Html\Link and add the conditions in the _toHtml method. ...
8
votes
Magento2.2.3 - Admin store configuration is save but not display in admin panel
I get the solution to this problem. If anyone faces this problem,
Require to remove var/page_cache and var/session folder. After saving the configuration, you can able to see changes in the admin ...
7
votes
Accepted
System configuration custom source model error
Dropdown cannot get it Source model
macerier_test/system_config_source_dropdown_values that why it showing the error
May be you did not define model prefix.
As per as your code macerier_test . ...
7
votes
Accepted
Conditionally show block in layout XML
Yes you can but you cannot check a specific value using layout. So for example, you can do the following that checks to make sure the contacts page is enabled;
<block class="Magento\Framework\View\...
6
votes
Accepted
Custom admin module system configuration not working - 404 Error
Okay, I figured it out (thanks to http://alanstorm.com/custom_magento_system_configuration).
Silly mistake on the ACL definition. This is the correct XML:
<acl>
<resources>
&...
6
votes
How to get store config inside a theme template
We can directly get a store config in the template by getting instance of Magento\Framework\App\Config\ScopeConfig:
\Magento\Framework\App\ObjectManager::getInstance()
->get('Magento\Framework\...
6
votes
Accepted
How to add a multiselect field to system config field table?
I haven't tested this, so I'm just taking a wild guess.
The link you mentioned from integer-net explains how to use a select field using a class ...
6
votes
Get system config option inside source model of another option
The way you approach to make the custom configuration fields dependant will be achieved through the steps suggested by @Piyush and @Lez(Using source models with request library).
However, this ...
6
votes
Implement "Use system value" in custom module
canRestore property
etc/adminhtml/system.xml
<field id="some" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
...
</...
6
votes
Accepted
Magento 2 : Specific Range Validation in system configuration field
Add this code in your system.xml :
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
5
votes
Accepted
Dependent Groups on System Configuration
You can put JavaScript in the comment area. It can be something like this:
<comment><![CDATA[
<script type="text/javascript">
document.observe("dom:loaded",function(){
...
5
votes
Accepted
Set Magento Config Data For Script Duration Only
The problem with setNode() is that it does not refresh the config cache in Mage_Core_Model_Store. This is not the Magento cache but a PHP array, populated at runtime on store initialization for store ...
5
votes
Magento 2 - How to config mail sending?
Mailing in Magento 2 isn't sended by smtp by default, it uses mail PHP function. To use smtp you have to install extension, ie. Extension1 (paid) or Extension2 (free)
You can also write your own ...
5
votes
Magento 2 - How to config mail sending?
Without adding an extention, the best way is to add and configure PostFix for Gmail account (Tested on Mac & Linux):
SASL Authentication
Connecting to the Gmail SMTP server requires both SSL and ...
5
votes
Accepted
Undefined index: label vendor/magento/framework/Data/Form/Element/Select.php on line 68
Was just a typo in my custom payment method's /etc/config.xml
<group>Offline</group>
Should be
<group>offline</group>
5
votes
Accepted
Magento1 Mage::getStoreConfig non cached value
I do not believe this is possible.
You could look into querying the database directly for the value in core_config_data but you should really let Magento handle the full configuration and merging as ...
5
votes
Accepted
Magento 2 toggle switch (yes/no) in admin config of custom module using system.xml or in any programmatic way
After several research, I come up with this solution. (Not a clean code but still able to come up with the expected results)
I ended up creating a block to be inserted in the admin system config using ...
4
votes
Accepted
Config value not rendering in Magento 2
Finally I have achieved by updating Customer.php file from Helper class
<?php
namespace Learning\Custom\Helper;
class Customer
{
const XML_PATH = 'custom_customer/custom_customer_nav_api/...
4
votes
Only one base currency is displaying in magento admin panel?
What I think has happened here is that the list of installed currencies has been edited. You can see this list under Advanced->System->Currency->Installed Currencies. What you can do here is ...
4
votes
Accepted
Page not found 404 when accessing custom module in system configuration
Most likely it's cache playing the role. Just Log Out and Log In again. See this why you need to do this.
Also, consider adding ACL role, if you haven't already added.
Learn how to add ACL here.
4
votes
Accepted
Admin config with extendable amount of fields
To add an "Add field" button to you config field, you can use this:
app/code/POOL/My/Module/etc/system.xml
<delay_by_country translate="label">
<label>Email delay per country</...
4
votes
get System configuration fields values - custom module
Recommended way
<?php
namespace QaisarSatti\HelloWorld\Helper;
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
public function getConfig($config_path)
{
return $...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
system-config × 165magento2 × 78
system.xml × 41
magento-1.9 × 26
configuration × 23
admin × 17
system-configuration × 17
core-config-data × 14
module × 9
magento2.2.2 × 9
magento-1 × 8
adminhtml × 8
magento-2.1 × 7
magento2.3 × 7
database × 5
magento2.2 × 5
backend × 5
admin-panel × 5
event-observer × 4
custom × 4
dynamic-rows × 4
source-model × 4
magento-1.8 × 3
layout × 3
xml × 3