{"id":1098,"date":"2020-01-06T03:33:33","date_gmt":"2020-01-06T03:33:33","guid":{"rendered":"https:\/\/www.magetop.com\/blog\/?p=1098"},"modified":"2021-07-22T03:00:13","modified_gmt":"2021-07-22T03:00:13","slug":"how-to-get-store-config-value-in-magento-2","status":"publish","type":"post","link":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/","title":{"rendered":"How To Get Store Config Value In Magento 2"},"content":{"rendered":"\n\n\n<p>In the previous article, we learned about <a href=\"https:\/\/www.magetop.com\/blog\/how-to-create-simple-module-to-configure-options-for-theme-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"How To Create Simple Module To Configure Options For Theme In Magento 2 (opens in a new tab)\">How To Create Simple Module To Configure Options For Theme In Magento 2<\/a>. Today, we will introduce you about <strong>How To Get Store Config Value In Magento 2<\/strong>.<\/p>\n\n\n\n<p>I think you should read the first article: <a href=\"https:\/\/www.magetop.com\/blog\/how-to-create-new-theme-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"How To Create New Theme In Magento 2 (opens in a new tab)\">How To Create New Theme In Magento 2<\/a> in the series. It will help you understand the basics of Theme in Magento 2.<\/p>\n\n\n\n<p>We&#8217;ll read the values directly from <code>app\/code\/Magetop\/Themes\/etc\/adminhtml\/system.xml<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1066\" height=\"566\" data-attachment-id=\"1115\" data-permalink=\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/codevalue\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/CodeValue.png?fit=1066%2C566&amp;ssl=1\" data-orig-size=\"1066,566\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"CodeValue\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/CodeValue.png?fit=300%2C159&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/CodeValue.png?fit=800%2C425&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/CodeValue.png?fit=800%2C425&amp;ssl=1\" alt=\"code config\" class=\"wp-image-1115\" srcset=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/CodeValue.png?w=1066&amp;ssl=1 1066w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/CodeValue.png?resize=300%2C159&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/CodeValue.png?resize=1024%2C544&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/CodeValue.png?resize=768%2C408&amp;ssl=1 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>The path config is <code>section\/group\/value<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get value yes\/no in xml file<\/h2>\n\n\n\n<p>For example: Create file <code>&lt;theme_dir&gt;\/Magetop_Themes\/layout\/default.xml<\/code> then insert the following code.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;page xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd&quot;&gt;\n    &lt;body&gt;\n        &lt;referenceContainer name=&quot;page.top&quot;&gt;\n            &lt;block ifconfig=&quot;themes\/general\/enable_topbanner&quot; class=&quot;Magento\\Framework\\View\\Element\\Template&quot;  name=&quot;top.banner&quot; template=&quot;Magetop_Themes::html\/mainBaner.phtml&quot;\/&gt;\n        &lt;\/referenceContainer&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;\n<\/pre><\/div>\n\n\n<p>Then create file <code>&lt;theme_dir&gt;\/Magetop_Themes\/templates\/html\/mainBaner.phtml<\/code> then insert the following code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;h1&gt;Create banner here&lt;\/h1&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Use helper get theme config then call it in template file<\/h2>\n\n\n\n<p>For example: Create file <code>app\/code\/Magetop\/Themes\/Helper\/Data.php <\/code>then insert the following code.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Themes\\Helper;\nclass Data extends \\Magento\\Framework\\App\\Helper\\AbstractHelper\n{\n    public function getConfig($path='')\n    {\n        if($path) return $this-&gt;scopeConfig-&gt;getValue( $path, \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE );\n        return $this-&gt;scopeConfig;\n    }\n}\n<\/pre><\/div>\n\n\n<p>Update file <code>&lt;theme_dir&gt;\/Magetop_Themes\/layout\/default.xml<\/code> should look like:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;page xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd&quot;&gt;\n    &lt;body&gt;\n        &lt;referenceContainer name=&quot;after.body.start&quot;&gt;\n            &lt;block class=&quot;Magento\\Framework\\View\\Element\\Template&quot; after=&quot;-&quot;  name=&quot;themes.configure&quot; template=&quot;Magetop_themes::html\/themeConfigure.phtml&quot;\/&gt;\n        &lt;\/referenceContainer&gt;\n        &lt;referenceContainer name=&quot;page.top&quot;&gt;\n            &lt;block ifconfig=&quot;themes\/general\/enable_topbanner&quot; class=&quot;Magento\\Framework\\View\\Element\\Template&quot;  name=&quot;top.banner&quot; template=&quot;Magetop_themes::html\/mainBaner.phtml&quot;\/&gt;\n        &lt;\/referenceContainer&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;\n<\/pre><\/div>\n\n\n<p>Then create file <code>&lt;theme_dir&gt;\/Magetop_Themes\/templates\/html\/themeConfigure.phtml<\/code> then insert the following code.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php \n    $cfg = $this-&gt;helper('Magetop\\Themes\\Helper\\Data')-&gt;getConfig('themes\/general\/wellcome_text');\n?&gt;\n&lt;p&gt;&lt;?php echo $cfg; ?&gt;&lt;\/p&gt;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Use Object Manager<\/h2>\n\n\n\n<p>But it isn&#8217;t a perfect choice, you should <a href=\"https:\/\/www.magetop.com\/blog\/how-to-create-simple-module-to-configure-options-for-theme-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"create simple module (opens in a new tab)\">create simple module<\/a> to customize your theme.<\/p>\n\n\n\n<p>For example: Go to backend enable top banner and upload banner img then update file <code>&lt;theme_dir&gt;\/Magetop_Themes\/templates\/html\/mainBaner.phtml<\/code> should look like.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\n    $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n    $mediaUrl = $objectManager-&gt;get('Magento\\Store\\Model\\StoreManagerInterface')\n                    -&gt;getStore()\n                    -&gt;getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA);\n    $bannerUrl = $objectManager\n            -&gt;get('Magento\\Framework\\App\\Config\\ScopeConfigInterface')\n            -&gt;getValue('themes\/general\/background_image');\n    $bannerImgBg = $mediaUrl . 'themes\/' . $bannerUrl;      \n?&gt;\n&lt;?php if($bannerUrl!=''): ?&gt;\n&lt;div class=&quot;top_banner&quot;&gt;\n    &lt;img src=&quot;&lt;?php echo $bannerImgBg; ?&gt;&quot; alt=&quot;&quot; \/&gt;\n&lt;\/div&gt;\n&lt;?php endif; ?&gt;\n<\/pre><\/div>\n\n\n<p>We updated our file structure looks as follows<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>app\/code\/Magetop\/\n  \u251c\u2500\u2500 Themes\/\n  \u2502   \u251c\u2500\u2500 Helper\/\n  \u2502   \u2502     \u251c\u2500\u2500 Data.php\n  app\/design\/frontend\/Magetop\/\n  \u251c\u2500\u2500 Default\/\n  \u2502   \u251c\u2500\u2500 Magetop_Themes\/\n  \u2502   \u2502     \u251c\u2500\u2500 layout\/\n  \u2502   \u2502     \u2502   \u251c\u2500\u2500 default.xml\n  \u2502   \u2502     \u251c\u2500\u2500 templates\/\n  \u2502   \u2502     \u2502   \u251c\u2500\u2500 html\/\n  \u2502   \u2502     \u2502   \u2502  \u251c\u2500\u2500 themeConfigure.phtml\n  \u2502   \u2502     \u2502   \u2502  \u251c\u2500\u2500 mainBaner.phtml<\/code><\/pre>\n\n\n\n<p>Good luck!<\/p>\n\n\n\n<p>This is How To Get Store Config Value In Magento 2<\/p>\n\n\n\n<p>You can see the next post:  <a href=\"https:\/\/www.magetop.com\/blog\/how-to-make-custom-page-layout-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"How to make custom page layout in Magento 2 (opens in a new tab)\">How to make custom page layout in Magento 2<\/a>.<\/p>\n\n\n\n<p>Follow us for more helpful tutorial!<\/p>\n\n\n\n<p>We hope this is useful blog for you.<\/p>\n\n\n\n<p>Thank you for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous article, we learned about How To Create Simple Module To Configure Options For Theme In Magento 2. Today, we will introduce you about How To Get Store Config Value In Magento 2.<\/p>\n","protected":false},"author":1,"featured_media":1116,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[206,207,204,205,107],"class_list":["post-1098","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento-2-tutorials","tag-get-store-config-value","tag-get-store-config-value-in-magento-2","tag-how-to-get-store-config-value","tag-how-to-get-store-config-value-in-magento-2","tag-magento-2-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Get Store Config Value In Magento 2 - Magetop Blog<\/title>\n<meta name=\"description\" content=\"Today, we will introduce you about How To Get Store Config Value In Magento 2. One of the very rewarding posts you should read...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Get Store Config Value In Magento 2 - Magetop Blog\" \/>\n<meta property=\"og:description\" content=\"Today, we will introduce you about How To Get Store Config Value In Magento 2. One of the very rewarding posts you should read...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Magetop Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/MagetopStore\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/MagetopStore\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-06T03:33:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-22T03:00:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i2.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"445\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Adam Roger\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/MagetopStore\" \/>\n<meta name=\"twitter:site\" content=\"@MagetopStore\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Adam Roger\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/\"},\"author\":{\"name\":\"Adam Roger\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/1bf4d5d0c4f280303345970448feb411\"},\"headline\":\"How To Get Store Config Value In Magento 2\",\"datePublished\":\"2020-01-06T03:33:33+00:00\",\"dateModified\":\"2021-07-22T03:00:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/\"},\"wordCount\":225,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1\",\"keywords\":[\"Get Store Config Value\",\"Get Store Config Value In Magento 2\",\"How To Get Store Config Value\",\"How To Get Store Config Value In Magento 2\",\"magento 2 tutorials\"],\"articleSection\":[\"Magento 2 Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/\",\"url\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/\",\"name\":\"How To Get Store Config Value In Magento 2 - Magetop Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1\",\"datePublished\":\"2020-01-06T03:33:33+00:00\",\"dateModified\":\"2021-07-22T03:00:13+00:00\",\"description\":\"Today, we will introduce you about How To Get Store Config Value In Magento 2. One of the very rewarding posts you should read...\",\"breadcrumb\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1\",\"width\":750,\"height\":445,\"caption\":\"How To Get Store Config Value M2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.magetop.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Get Store Config Value In Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#website\",\"url\":\"https:\/\/www.magetop.com\/blog\/\",\"name\":\"Magetop Blog\",\"description\":\"Exploring Magento Tips, Tricks, and Trends\",\"publisher\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.magetop.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\",\"name\":\"Magetop.com\",\"url\":\"https:\/\/www.magetop.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1\",\"width\":475,\"height\":475,\"caption\":\"Magetop.com\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/MagetopStore\",\"https:\/\/x.com\/MagetopStore\",\"https:\/\/www.linkedin.com\/company\/magetop\",\"https:\/\/www.pinterest.com\/magetop\",\"https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/1bf4d5d0c4f280303345970448feb411\",\"name\":\"Adam Roger\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2ea543086258299e700cc48d893c02653c4a87b5466f23de66240a677d192811?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2ea543086258299e700cc48d893c02653c4a87b5466f23de66240a677d192811?s=96&d=mm&r=g\",\"caption\":\"Adam Roger\"},\"description\":\"CEO and Founder of Magetop. A friend, a husband and a dad of two children. Adam loves to travel to experience new cultures and discover what is happening with ecommerce all around the world.\",\"sameAs\":[\"https:\/\/www.magetop.com\",\"https:\/\/www.facebook.com\/MagetopStore\",\"https:\/\/www.instagram.com\/magetopstore\",\"https:\/\/www.linkedin.com\/company\/magetop\",\"https:\/\/www.pinterest.com\/magetop\",\"https:\/\/x.com\/https:\/\/twitter.com\/MagetopStore\",\"https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA\",\"https:\/\/magetop.tumblr.com\"],\"url\":\"https:\/\/www.magetop.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Get Store Config Value In Magento 2 - Magetop Blog","description":"Today, we will introduce you about How To Get Store Config Value In Magento 2. One of the very rewarding posts you should read...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"How To Get Store Config Value In Magento 2 - Magetop Blog","og_description":"Today, we will introduce you about How To Get Store Config Value In Magento 2. One of the very rewarding posts you should read...","og_url":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/","og_site_name":"Magetop Blog","article_publisher":"https:\/\/www.facebook.com\/MagetopStore","article_author":"https:\/\/www.facebook.com\/MagetopStore","article_published_time":"2020-01-06T03:33:33+00:00","article_modified_time":"2021-07-22T03:00:13+00:00","og_image":[{"width":750,"height":445,"url":"https:\/\/i2.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1","type":"image\/png"}],"author":"Adam Roger","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/MagetopStore","twitter_site":"@MagetopStore","twitter_misc":{"Written by":"Adam Roger","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#article","isPartOf":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/"},"author":{"name":"Adam Roger","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/1bf4d5d0c4f280303345970448feb411"},"headline":"How To Get Store Config Value In Magento 2","datePublished":"2020-01-06T03:33:33+00:00","dateModified":"2021-07-22T03:00:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/"},"wordCount":225,"commentCount":0,"publisher":{"@id":"https:\/\/www.magetop.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1","keywords":["Get Store Config Value","Get Store Config Value In Magento 2","How To Get Store Config Value","How To Get Store Config Value In Magento 2","magento 2 tutorials"],"articleSection":["Magento 2 Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/","url":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/","name":"How To Get Store Config Value In Magento 2 - Magetop Blog","isPartOf":{"@id":"https:\/\/www.magetop.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1","datePublished":"2020-01-06T03:33:33+00:00","dateModified":"2021-07-22T03:00:13+00:00","description":"Today, we will introduce you about How To Get Store Config Value In Magento 2. One of the very rewarding posts you should read...","breadcrumb":{"@id":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#primaryimage","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1","width":750,"height":445,"caption":"How To Get Store Config Value M2"},{"@type":"BreadcrumbList","@id":"https:\/\/www.magetop.com\/blog\/how-to-get-store-config-value-in-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.magetop.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Get Store Config Value In Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/www.magetop.com\/blog\/#website","url":"https:\/\/www.magetop.com\/blog\/","name":"Magetop Blog","description":"Exploring Magento Tips, Tricks, and Trends","publisher":{"@id":"https:\/\/www.magetop.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.magetop.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.magetop.com\/blog\/#organization","name":"Magetop.com","url":"https:\/\/www.magetop.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1","width":475,"height":475,"caption":"Magetop.com"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/MagetopStore","https:\/\/x.com\/MagetopStore","https:\/\/www.linkedin.com\/company\/magetop","https:\/\/www.pinterest.com\/magetop","https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA"]},{"@type":"Person","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/1bf4d5d0c4f280303345970448feb411","name":"Adam Roger","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2ea543086258299e700cc48d893c02653c4a87b5466f23de66240a677d192811?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2ea543086258299e700cc48d893c02653c4a87b5466f23de66240a677d192811?s=96&d=mm&r=g","caption":"Adam Roger"},"description":"CEO and Founder of Magetop. A friend, a husband and a dad of two children. Adam loves to travel to experience new cultures and discover what is happening with ecommerce all around the world.","sameAs":["https:\/\/www.magetop.com","https:\/\/www.facebook.com\/MagetopStore","https:\/\/www.instagram.com\/magetopstore","https:\/\/www.linkedin.com\/company\/magetop","https:\/\/www.pinterest.com\/magetop","https:\/\/x.com\/https:\/\/twitter.com\/MagetopStore","https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA","https:\/\/magetop.tumblr.com"],"url":"https:\/\/www.magetop.com\/blog\/author\/admin\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Get-Store-Config-Value.png?fit=750%2C445&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/paOdw5-hI","jetpack-related-posts":[{"id":1144,"url":"https:\/\/www.magetop.com\/blog\/make-default-system-config-value-in-magento-2\/","url_meta":{"origin":1098,"position":0},"title":"Make Default System Config Value In Magento 2","author":"Adam Roger","date":"January 12, 2020","format":false,"excerpt":"In the previous article, we learned about Add Custom Category Attributes In Magento 2. Today, we will introduce you about Make default system config value in Magento 2. I think you should read How To Create New Theme In Magento 2 first.","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"Make Default System Config Value In Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/Make-Default-System-Config-Value.png?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/Make-Default-System-Config-Value.png?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/Make-Default-System-Config-Value.png?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/Make-Default-System-Config-Value.png?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1091,"url":"https:\/\/www.magetop.com\/blog\/how-to-create-simple-module-to-configure-options-for-theme-in-magento-2\/","url_meta":{"origin":1098,"position":1},"title":"How To Create Simple Module To Configure Options For Theme In Magento 2","author":"Adam Roger","date":"January 4, 2020","format":false,"excerpt":"In this article, we will introduce you to How to create simple module to configure options for theme in Magento 2.","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"How To Create Simple Module To Configure Options For Theme","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Create-Simple-Module-To-Configure-Options-For-Theme.png?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Create-Simple-Module-To-Configure-Options-For-Theme.png?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Create-Simple-Module-To-Configure-Options-For-Theme.png?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/How-To-Create-Simple-Module-To-Configure-Options-For-Theme.png?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1138,"url":"https:\/\/www.magetop.com\/blog\/add-custom-category-attributes-in-magento-2\/","url_meta":{"origin":1098,"position":2},"title":"Add Custom Category Attributes In Magento 2","author":"Adam Roger","date":"January 12, 2020","format":false,"excerpt":"In the previous article, we learned about How to get product collection in Magento 2. Today, we will introduce you about Add custom category attributes in Magento 2. I think you should read How To Create New Theme In Magento 2 first.","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"Add Custom Category Attributes In Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/Add-Custom-Category-Attributes.png?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/Add-Custom-Category-Attributes.png?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/Add-Custom-Category-Attributes.png?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/01\/Add-Custom-Category-Attributes.png?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3659,"url":"https:\/\/www.magetop.com\/blog\/magento-2-configure-full-page-cache\/","url_meta":{"origin":1098,"position":3},"title":"How To Configure Full-Page Cache In Magento 2","author":"Aaron LX","date":"December 10, 2020","format":false,"excerpt":"Magento provides a solution that uses full page caching to improve website performance. Quickly display category, products, CMS pages, improve response time, reduce server load. The special thing is that you can easily enable it in the Admin Panel. In this post, I will guide you How To Configure Full-Page\u2026","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"How To Configure Full-Page Cache In Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Configure-Full-Page-Cache-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Configure-Full-Page-Cache-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Configure-Full-Page-Cache-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Configure-Full-Page-Cache-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3558,"url":"https:\/\/www.magetop.com\/blog\/magento-2-enable-single-store-mode\/","url_meta":{"origin":1098,"position":4},"title":"How To Enable Single Store Mode In Magento 2","author":"Aaron LX","date":"December 2, 2020","format":false,"excerpt":"Magento allows you to manage multi-stores easily, which is very useful for store owners who own lots of stores, including multinational stores with just one dashboard. But Magento also gives you Single Store Mode which helps you manage your unique store. In this article, I will show you How To\u2026","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"How To Enable Single Store Mode In Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Enable-Single-Store-Mode-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Enable-Single-Store-Mode-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Enable-Single-Store-Mode-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/12\/How-To-Enable-Single-Store-Mode-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":4115,"url":"https:\/\/www.magetop.com\/blog\/magento-2-allow-guests-to-write-reviews\/","url_meta":{"origin":1098,"position":5},"title":"How To Allow Guests To Write Reviews In Magento 2","author":"Aaron LX","date":"January 7, 2021","format":false,"excerpt":"If you are selling online, allowing guests to write reviews of products they bought or sent back is essential. In this post, I will guide you How To Allow Guests To Write Reviews In Magento 2.","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"How To Allow Guests To Write Reviews In Magento 2","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/01\/How-To-Allow-Guests-To-Write-Reviews-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/01\/How-To-Allow-Guests-To-Write-Reviews-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/01\/How-To-Allow-Guests-To-Write-Reviews-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/01\/How-To-Allow-Guests-To-Write-Reviews-In-Magento-2.jpg?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/1098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/comments?post=1098"}],"version-history":[{"count":12,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/1098\/revisions"}],"predecessor-version":[{"id":5906,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/1098\/revisions\/5906"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/media\/1116"}],"wp:attachment":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/media?parent=1098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/categories?post=1098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/tags?post=1098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}