You can identify Company module status like enable/disable using programmatic way.
Native Company module has a class called Magento\Company\Api\StatusServiceInterface contains the method isActive() to check the module status.
Just instantiate the interface in your class file and call method to verify the company module status.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <?php namespace Jesadiya\CompanyModuleEnable\Model; use Magento\Company\Api\StatusServiceInterface; class CompanyModuleEnable { /** * @var StatusServiceInterface */ private $companyStatus; public function __construct( StatusServiceInterface $companyStatus ) { $this->companyStatus = $companyStatus; } /** * Return user type * * @return bool */ public function isCompanyModuleActive(): ?bool { $isCompanyEnable = $this->companyStatus->isActive(); return $isCompanyEnable; } } |
Call method to identify status,
echo $isCompanyActive = $this->isCompanyModuleActive();
If Output is 1, Company module is enable to work with B2B in Magento.
Output:
Boolean