How to get Dependent(Sequence) module list of a specific module programmatically in Magento 2?

You can get the list of dependent module and schema version for a specific module using programmatically by Magento\Framework\Module\ModuleList class.

You can manually check the list of the dependent module for a module using an etc/module.xml file.

Let’s we Check the dependency list for a Catalog Module. you can check the module.xml file for catalog module is,

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Magento_Catalog" >
        <sequence>
            <module name="Magento_Eav"/>
            <module name="Magento_Cms"/>
            <module name="Magento_Indexer"/>
            <module name="Magento_Customer"/>
        </sequence>
    </module>
</config>

you can check above XML, There are four modules on which catalog is dependent.  Continue reading “How to get Dependent(Sequence) module list of a specific module programmatically in Magento 2?”

Magento 2 Get all the Enable (Active) module list programmatically.

You can get the list of all Enable module in Magento 2.  You can manually check your all the enable module list from app/etc/config.php file module name with status set to 1.

‘Magento_Store’ => 1 Store Module is Enable.

‘MSP_ReCaptcha’ => 0 Recaptcha Module is disable. Continue reading “Magento 2 Get all the Enable (Active) module list programmatically.”

How to create Guest Empty Cart quote programmatically in Magento 2?

Magento 2, You can create a Guest or anonymous customer empty quote programmatically using Magento\Quote\Api\GuestCartManagementInterface class.

You can create quote entry using interface GuestCartManagementInterface Continue reading “How to create Guest Empty Cart quote programmatically in Magento 2?”