How to add Enable/Disable extention functionality in admin side in custom extention magento 2.3Custom Magento Extension Enable and Disable by my custom admin moduleHow to Enable and Disable Custom Magento Extension?How to disable a magento extension from admin?Custom extension disable functionality is not workingMagento 2 - Create Admin Grid and show Custom Module list with Enable/Disable optionMagento 2 - add Enable / Disable field for custom moduleMagento 2 how to add custom tab in admin order view page left sideHow to add custom media gallery upload functionality in magento2?Add module Enable/disable functionality in Magento 2How to add new field to Admin User Info in Magento 2?

Should I prioritize my 401k over my student loans?

Trainee keeps missing deadlines for independent learning

How does a blind passenger not die, if driver becomes unconscious

Suggested order for Amazon Prime Doctor Who series

How many people are necessary to maintain modern civilisation?

Can humans ever directly see a few photons at a time? Can a human see a single photon?

Count All Possible Unique Combinations of Letters in a Word

What reason would an alien civilization have for building a Dyson Sphere (or Swarm) if cheap Nuclear fusion is available?

Should developer taking test phones home or put in office?

Interaction between Leyline of Anticipation and Teferi, Time Raveler

What exactly is the 'online' in OLAP and OLTP?

Is there a term for the belief that "if it's legal, it's moral"?

What did River say when she woke from her proto-comatose state?

What is "industrial ethernet"?

Is it illegal to withhold someone's passport and green card in California?

Who are the remaining King/Queenslayers?

How do I turn off a repeating trade?

How to make clear to people I don't want to answer their "Where are you from?" question?

Parameterize chained calls to a utility program in Bash

What was the Shuttle Carrier Aircraft escape tunnel?

Why is prior to creation called holy?

Helping ease my back pain when I'm studying 13 hours everyday, even weekends

Why does Linux list NVMe drives as /dev/nvme0 instead of /dev/sda?

How dangerous are set-size assumptions?



How to add Enable/Disable extention functionality in admin side in custom extention magento 2.3


Custom Magento Extension Enable and Disable by my custom admin moduleHow to Enable and Disable Custom Magento Extension?How to disable a magento extension from admin?Custom extension disable functionality is not workingMagento 2 - Create Admin Grid and show Custom Module list with Enable/Disable optionMagento 2 - add Enable / Disable field for custom moduleMagento 2 how to add custom tab in admin order view page left sideHow to add custom media gallery upload functionality in magento2?Add module Enable/disable functionality in Magento 2How to add new field to Admin User Info in Magento 2?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4















We want to create one custom extension which has functionality in admin side for Enable/Disable.
Any one help me how to add this functionality in my custom extension.










share|improve this question
























  • How you want to use this setting is the main thing? Custom Plugin, Events, Preferences still will be executed.

    – MagePsycho
    Jun 13 at 13:39











  • We use this custom plugin only for overwrite phtml files of product.

    – Anil
    Jun 13 at 14:07

















4















We want to create one custom extension which has functionality in admin side for Enable/Disable.
Any one help me how to add this functionality in my custom extension.










share|improve this question
























  • How you want to use this setting is the main thing? Custom Plugin, Events, Preferences still will be executed.

    – MagePsycho
    Jun 13 at 13:39











  • We use this custom plugin only for overwrite phtml files of product.

    – Anil
    Jun 13 at 14:07













4












4








4








We want to create one custom extension which has functionality in admin side for Enable/Disable.
Any one help me how to add this functionality in my custom extension.










share|improve this question
















We want to create one custom extension which has functionality in admin side for Enable/Disable.
Any one help me how to add this functionality in my custom extension.







magento2 admin extensions enable-disable






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 14 at 6:56









Muhammad Farzam

7916




7916










asked Jun 13 at 13:11









AnilAnil

969




969












  • How you want to use this setting is the main thing? Custom Plugin, Events, Preferences still will be executed.

    – MagePsycho
    Jun 13 at 13:39











  • We use this custom plugin only for overwrite phtml files of product.

    – Anil
    Jun 13 at 14:07

















  • How you want to use this setting is the main thing? Custom Plugin, Events, Preferences still will be executed.

    – MagePsycho
    Jun 13 at 13:39











  • We use this custom plugin only for overwrite phtml files of product.

    – Anil
    Jun 13 at 14:07
















How you want to use this setting is the main thing? Custom Plugin, Events, Preferences still will be executed.

– MagePsycho
Jun 13 at 13:39





How you want to use this setting is the main thing? Custom Plugin, Events, Preferences still will be executed.

– MagePsycho
Jun 13 at 13:39













We use this custom plugin only for overwrite phtml files of product.

– Anil
Jun 13 at 14:07





We use this custom plugin only for overwrite phtml files of product.

– Anil
Jun 13 at 14:07










3 Answers
3






active

oldest

votes


















1














For this, you need to Create a System.xml in the folder like etc/adminhtml/System.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
 <system>
<tab id="ModuleName" translate="label" sortOrder="10">
<label>ModuleName</label>
</tab>

<section id="customproductdata" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
 <class>separator-top</class>
<label>Custom Product Data</label>
  <tab>ModuleName</tab>
<resource>ModuleName_Customproductdata::customproductdata_configuration</resource>
<group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>General Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
 <label>Enable</label>
  <source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
 </group>
</section>
</system>




 

Than Create Config.xml file as the Same location and Put Below code into that.



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<customproductdata>
<general>
  <enable>1</enable>
<title>ModuleName Customproductdata</title>
  </general>
</customproductdata>
</default>
</config>


Now you will See this custom Yes no option in Magento 2 admin section.






share|improve this answer























  • Thanks. It's work perfectly.

    – Anil
    Jun 14 at 7:34











  • If answer was correct or satisfy with answer please approved answer.

    – Vijay-CyberLocker
    Jun 14 at 9:12


















1














Create system.xml in your module.




etc/adminhtml/system.xml




Add the following content to have enable disable module configuration.



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="yourmodulename" translate="label" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="1">
<resource>Vendor_YourModuleName::configuration</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Enable Module</label>
<source_model>MagentoConfigModelConfigSourceEnabledisable</source_model>
</field>
</group>
</section>
</system>
</config>





share|improve this answer























  • In admin site where this setting show ? Enable or Disable

    – Hafiz Arslan
    Jun 13 at 14:04


















1














Add below code in etc/adminhtml/system.xml



<group id="general" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20">
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1">
<label>Enable</label>
<source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
</group>


Using below code in helper file.



public function isEnabled()

return (boolean) $this->getConfig('namespace_modulename/general/enable');



And call this function whenever you want.
That's it, i hope it helps!






share|improve this answer























  • If any possible way to create extension with enable/disable option ?

    – Anil
    Jun 13 at 14:44











  • I have a post answer for that. but I think you are confused. can you explain more what do you want exactly?

    – Chirag Patel
    Jun 14 at 4:38











  • we want to create one custom extension. Which in manage from admin side. It means any person enable/disable it from admin side. Main purpose for create this extension is overwrite phtml files for product view page.

    – Anil
    Jun 14 at 5:53














Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f278261%2fhow-to-add-enable-disable-extention-functionality-in-admin-side-in-custom-extent%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














For this, you need to Create a System.xml in the folder like etc/adminhtml/System.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
 <system>
<tab id="ModuleName" translate="label" sortOrder="10">
<label>ModuleName</label>
</tab>

<section id="customproductdata" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
 <class>separator-top</class>
<label>Custom Product Data</label>
  <tab>ModuleName</tab>
<resource>ModuleName_Customproductdata::customproductdata_configuration</resource>
<group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>General Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
 <label>Enable</label>
  <source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
 </group>
</section>
</system>




 

Than Create Config.xml file as the Same location and Put Below code into that.



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<customproductdata>
<general>
  <enable>1</enable>
<title>ModuleName Customproductdata</title>
  </general>
</customproductdata>
</default>
</config>


Now you will See this custom Yes no option in Magento 2 admin section.






share|improve this answer























  • Thanks. It's work perfectly.

    – Anil
    Jun 14 at 7:34











  • If answer was correct or satisfy with answer please approved answer.

    – Vijay-CyberLocker
    Jun 14 at 9:12















1














For this, you need to Create a System.xml in the folder like etc/adminhtml/System.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
 <system>
<tab id="ModuleName" translate="label" sortOrder="10">
<label>ModuleName</label>
</tab>

<section id="customproductdata" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
 <class>separator-top</class>
<label>Custom Product Data</label>
  <tab>ModuleName</tab>
<resource>ModuleName_Customproductdata::customproductdata_configuration</resource>
<group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>General Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
 <label>Enable</label>
  <source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
 </group>
</section>
</system>




 

Than Create Config.xml file as the Same location and Put Below code into that.



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<customproductdata>
<general>
  <enable>1</enable>
<title>ModuleName Customproductdata</title>
  </general>
</customproductdata>
</default>
</config>


Now you will See this custom Yes no option in Magento 2 admin section.






share|improve this answer























  • Thanks. It's work perfectly.

    – Anil
    Jun 14 at 7:34











  • If answer was correct or satisfy with answer please approved answer.

    – Vijay-CyberLocker
    Jun 14 at 9:12













1












1








1







For this, you need to Create a System.xml in the folder like etc/adminhtml/System.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
 <system>
<tab id="ModuleName" translate="label" sortOrder="10">
<label>ModuleName</label>
</tab>

<section id="customproductdata" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
 <class>separator-top</class>
<label>Custom Product Data</label>
  <tab>ModuleName</tab>
<resource>ModuleName_Customproductdata::customproductdata_configuration</resource>
<group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>General Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
 <label>Enable</label>
  <source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
 </group>
</section>
</system>




 

Than Create Config.xml file as the Same location and Put Below code into that.



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<customproductdata>
<general>
  <enable>1</enable>
<title>ModuleName Customproductdata</title>
  </general>
</customproductdata>
</default>
</config>


Now you will See this custom Yes no option in Magento 2 admin section.






share|improve this answer













For this, you need to Create a System.xml in the folder like etc/adminhtml/System.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
 <system>
<tab id="ModuleName" translate="label" sortOrder="10">
<label>ModuleName</label>
</tab>

<section id="customproductdata" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
 <class>separator-top</class>
<label>Custom Product Data</label>
  <tab>ModuleName</tab>
<resource>ModuleName_Customproductdata::customproductdata_configuration</resource>
<group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>General Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
 <label>Enable</label>
  <source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
 </group>
</section>
</system>




 

Than Create Config.xml file as the Same location and Put Below code into that.



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<customproductdata>
<general>
  <enable>1</enable>
<title>ModuleName Customproductdata</title>
  </general>
</customproductdata>
</default>
</config>


Now you will See this custom Yes no option in Magento 2 admin section.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 14 at 7:32









NikulNikul

75511122




75511122












  • Thanks. It's work perfectly.

    – Anil
    Jun 14 at 7:34











  • If answer was correct or satisfy with answer please approved answer.

    – Vijay-CyberLocker
    Jun 14 at 9:12

















  • Thanks. It's work perfectly.

    – Anil
    Jun 14 at 7:34











  • If answer was correct or satisfy with answer please approved answer.

    – Vijay-CyberLocker
    Jun 14 at 9:12
















Thanks. It's work perfectly.

– Anil
Jun 14 at 7:34





Thanks. It's work perfectly.

– Anil
Jun 14 at 7:34













If answer was correct or satisfy with answer please approved answer.

– Vijay-CyberLocker
Jun 14 at 9:12





If answer was correct or satisfy with answer please approved answer.

– Vijay-CyberLocker
Jun 14 at 9:12













1














Create system.xml in your module.




etc/adminhtml/system.xml




Add the following content to have enable disable module configuration.



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="yourmodulename" translate="label" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="1">
<resource>Vendor_YourModuleName::configuration</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Enable Module</label>
<source_model>MagentoConfigModelConfigSourceEnabledisable</source_model>
</field>
</group>
</section>
</system>
</config>





share|improve this answer























  • In admin site where this setting show ? Enable or Disable

    – Hafiz Arslan
    Jun 13 at 14:04















1














Create system.xml in your module.




etc/adminhtml/system.xml




Add the following content to have enable disable module configuration.



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="yourmodulename" translate="label" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="1">
<resource>Vendor_YourModuleName::configuration</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Enable Module</label>
<source_model>MagentoConfigModelConfigSourceEnabledisable</source_model>
</field>
</group>
</section>
</system>
</config>





share|improve this answer























  • In admin site where this setting show ? Enable or Disable

    – Hafiz Arslan
    Jun 13 at 14:04













1












1








1







Create system.xml in your module.




etc/adminhtml/system.xml




Add the following content to have enable disable module configuration.



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="yourmodulename" translate="label" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="1">
<resource>Vendor_YourModuleName::configuration</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Enable Module</label>
<source_model>MagentoConfigModelConfigSourceEnabledisable</source_model>
</field>
</group>
</section>
</system>
</config>





share|improve this answer













Create system.xml in your module.




etc/adminhtml/system.xml




Add the following content to have enable disable module configuration.



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="yourmodulename" translate="label" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="1">
<resource>Vendor_YourModuleName::configuration</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Enable Module</label>
<source_model>MagentoConfigModelConfigSourceEnabledisable</source_model>
</field>
</group>
</section>
</system>
</config>






share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 13 at 13:29









Kazim NooraniKazim Noorani

1,1551824




1,1551824












  • In admin site where this setting show ? Enable or Disable

    – Hafiz Arslan
    Jun 13 at 14:04

















  • In admin site where this setting show ? Enable or Disable

    – Hafiz Arslan
    Jun 13 at 14:04
















In admin site where this setting show ? Enable or Disable

– Hafiz Arslan
Jun 13 at 14:04





In admin site where this setting show ? Enable or Disable

– Hafiz Arslan
Jun 13 at 14:04











1














Add below code in etc/adminhtml/system.xml



<group id="general" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20">
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1">
<label>Enable</label>
<source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
</group>


Using below code in helper file.



public function isEnabled()

return (boolean) $this->getConfig('namespace_modulename/general/enable');



And call this function whenever you want.
That's it, i hope it helps!






share|improve this answer























  • If any possible way to create extension with enable/disable option ?

    – Anil
    Jun 13 at 14:44











  • I have a post answer for that. but I think you are confused. can you explain more what do you want exactly?

    – Chirag Patel
    Jun 14 at 4:38











  • we want to create one custom extension. Which in manage from admin side. It means any person enable/disable it from admin side. Main purpose for create this extension is overwrite phtml files for product view page.

    – Anil
    Jun 14 at 5:53
















1














Add below code in etc/adminhtml/system.xml



<group id="general" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20">
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1">
<label>Enable</label>
<source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
</group>


Using below code in helper file.



public function isEnabled()

return (boolean) $this->getConfig('namespace_modulename/general/enable');



And call this function whenever you want.
That's it, i hope it helps!






share|improve this answer























  • If any possible way to create extension with enable/disable option ?

    – Anil
    Jun 13 at 14:44











  • I have a post answer for that. but I think you are confused. can you explain more what do you want exactly?

    – Chirag Patel
    Jun 14 at 4:38











  • we want to create one custom extension. Which in manage from admin side. It means any person enable/disable it from admin side. Main purpose for create this extension is overwrite phtml files for product view page.

    – Anil
    Jun 14 at 5:53














1












1








1







Add below code in etc/adminhtml/system.xml



<group id="general" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20">
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1">
<label>Enable</label>
<source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
</group>


Using below code in helper file.



public function isEnabled()

return (boolean) $this->getConfig('namespace_modulename/general/enable');



And call this function whenever you want.
That's it, i hope it helps!






share|improve this answer













Add below code in etc/adminhtml/system.xml



<group id="general" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20">
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1">
<label>Enable</label>
<source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
</group>


Using below code in helper file.



public function isEnabled()

return (boolean) $this->getConfig('namespace_modulename/general/enable');



And call this function whenever you want.
That's it, i hope it helps!







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 13 at 13:32









Chirag PatelChirag Patel

3,382627




3,382627












  • If any possible way to create extension with enable/disable option ?

    – Anil
    Jun 13 at 14:44











  • I have a post answer for that. but I think you are confused. can you explain more what do you want exactly?

    – Chirag Patel
    Jun 14 at 4:38











  • we want to create one custom extension. Which in manage from admin side. It means any person enable/disable it from admin side. Main purpose for create this extension is overwrite phtml files for product view page.

    – Anil
    Jun 14 at 5:53


















  • If any possible way to create extension with enable/disable option ?

    – Anil
    Jun 13 at 14:44











  • I have a post answer for that. but I think you are confused. can you explain more what do you want exactly?

    – Chirag Patel
    Jun 14 at 4:38











  • we want to create one custom extension. Which in manage from admin side. It means any person enable/disable it from admin side. Main purpose for create this extension is overwrite phtml files for product view page.

    – Anil
    Jun 14 at 5:53

















If any possible way to create extension with enable/disable option ?

– Anil
Jun 13 at 14:44





If any possible way to create extension with enable/disable option ?

– Anil
Jun 13 at 14:44













I have a post answer for that. but I think you are confused. can you explain more what do you want exactly?

– Chirag Patel
Jun 14 at 4:38





I have a post answer for that. but I think you are confused. can you explain more what do you want exactly?

– Chirag Patel
Jun 14 at 4:38













we want to create one custom extension. Which in manage from admin side. It means any person enable/disable it from admin side. Main purpose for create this extension is overwrite phtml files for product view page.

– Anil
Jun 14 at 5:53






we want to create one custom extension. Which in manage from admin side. It means any person enable/disable it from admin side. Main purpose for create this extension is overwrite phtml files for product view page.

– Anil
Jun 14 at 5:53


















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f278261%2fhow-to-add-enable-disable-extention-functionality-in-admin-side-in-custom-extent%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form