Category Archives: Development

Run Magento 2 Command On Root Directory With PHP Script

Magento 2 command With php script

Follow below instructions to run the magento 2 commands: Create a new file on Magento 2 root directory(command.php). Add the following codes in the newly created file. <?php use Magento\Framework\App\Bootstrap; require ‘app/bootstrap.php’; $bootstrap = Bootstrap::create(BP, $_SERVER); $objectManager = $bootstrap->getObjectManager(); $state = $objectManager->get(‘Magento\Framework\App\State’); $state->setAreaCode(‘frontend’); //command code here /*shell_exec(‘your_magento_2_commands’);              –OR– system(‘your_magento_2_commands’); […]

Create a custom theme in Magento 2

Create a custom theme in Magento 2

Please follow the steps to create a custom theme in Magento 2 Step 1: Create a directory for ThemeCreate a directory in app/desing/frontend/ with vendor name and theme like:app/design/frontend/vendorName/themeName Step 2: Declare theme.xml under the theme directoryCreate a theme.xml file under “app/design/frontend/vendorName/themeName” this file will have theme name, parent theme name and preview of the […]