Hello Magento friends todays im share with you to check Module enables or not in magento
in mageno2 to check Module enables or not from a system configuration setting follow Bellow Steps Carefully.
Every Professional third party Module in magento contains the Is Active or Enable feature for a module from
➤ System -> Configuration settings.
➤ To Check module is Active/Deative or enable/disable or not in magento,
In here I have just created a Model file
app/code/Deep/Mageget/Model/ConfigData.php file
<?php
declare(strict_types=1);
/**
* @author Deepak Mageget
* @package Deep_Mageget
*/
namespace Deep\Mageget\Model;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;
class ConfigData
{
const XML_PATH_CHECK_MODULE_ENABLE = 'section_name/group_name/field_name';
private $scopeConfig;
public function __construct(
ScopeConfigInterface $scopeConfig
) {
$this->scopeConfig = $scopeConfig;
}
public function isModuleEnable(): bool
{
return (bool)$this->scopeConfig->getValue(
self::XML_PATH_CHECK_MODULE_ENABLE,
ScopeInterface::SCOPE_STORE
);
}
}
.png)