Category Archives: Magento2

Custom API for Magento 2

Custom api in magento 2 means helping online retailers an Application Programming Interface for the own using. API is a required element to connect among the data if you ask for any program or service from other websites. With API’s, you can easily get all building blocks to initiate a program successfully. You can test […]

How to add custom javascript in Magento 2 with require JS?

Create a new module with Bay20_Bay20CustomJS Step 1: Create registration.php file. app/code/Bay20/Bay20CustomJS/registration.php Step 2: Create module.xml file. app/code/Bay20/Bay20CustomJS/etc/module.xml Step 3: Create requirejs-config.js file. app/code/Bay20/Bay20CustomJS/view/frontend/requirejs-config.js Step 4: Create test.phtml file app/code/Bay20/Bay20CustomJS/view/frontend/templates/test.phtml Step 5: Create wkrequirejs.js file. app/code/Bay20/Bay20CustomJS/view/frontend/web/js/wkrequirejs.js Step 6: Run the below command.

How to add Custom CMS page layout in Magento 2?

We will create custom layout with named Knowband Layout. Create a new module with CustomLayout_CustomCMS. Step 1: Create registration.php file. app/design/frontend/CustomLayout/CustomCMS/registration.php Step 2: Create module.xml file. app/design/frontend/CustomLayout/CustomCMS/etc/module.xml Step 3: Create kb_layout.xml file. app/design/frontend/CustomLayout/CustomCMS/view/frontend/page_layout/kb_layout.xml Step 4: Create layouts.xml file. app/design/frontend/CustomLayout/CustomCMS/view/frontend/layouts.xml Step 5: Run the below command. After creating these files, your custom layout will be added […]

How to add new console command in Magento 2

Create a new module with CustomCommandLine_ConsoleCommand. Step 1: Create registration.php file. app/code/CustomCommandLine/ConsoleCommand/registration.php Step 2: Create module.xml file. app/code/CustomCommandLine/ConsoleCommand/etc/module.xml Step 3: Create di.xml file. app/code/CustomCommandLine/ConsoleCommand/etc/di.xml Step 4: Create Generation.php file. app/code/CustomCommandLine/ConsoleCommand/Model/Generation.php Step 5: Next, we need to check if your new command is shown in the command list or not for that you need to run […]

Setup scripts in Magento 2

Create a new module with CustomScripts_SetupScripts Step 1: Create module.xml file. app/code/CustomScripts/SetupScripts/etc/module.xml Step 2: Create registration.php file. app/code/CustomScripts/SetupScripts/registration.php Step 3: Create InstallSchema.php file. app/code/CustomScripts/SetupScripts/Setup/InstallSchema.php Step 4: Create InstallData.php file. app/code/CustomScripts/SetupScripts/InstallData.php Step 5: Create UpgradeSchema.php file. app/code/CustomScripts/SetupScripts/Setup/UpgradeSchema.php Step 6: Create UpgradeData.php file. app/code/CustomScripts/SetupScripts/Setup/UpgradeData.php Step 7: Create Recurring.php file. app/code/CustomScripts/SetupScripts/Setup/Recurring.php Step 8: Create Uninstall.php file. app/code/CustomScripts/SetupScripts/Setup/Uninstall.php