Node.js: Include another JS, ENV, JSON file in the app

This article shows how you can include another JS (Javascript) file into your main application JS file. We can have a situation where we store configuration settings or database settings in another file. It can be .js, .env, .json or any other file. We will be using module.exports object to achieve this. I have created … Read more

Magento 2: Enable/Disable Module via Command Line

This article shows how you can enable or disable Magento 2 modules using the command line. In my previous article, I have listed out all the command line tools that can be used in Magento 2. This article specifically shows about commands to enable/disable Magento 2 modules. Get the List of All Modules First of … Read more

Node.js: Packaging your Node.js Module/Project

This article shows how you can package your Node.js module or project using npm init command. Running this command will create a package.json file which contains all the necessary packaging information. Here’s a step-by-step guide to create package file with npm init command. 1) Open terminal/command-prompt 2) Go to your Node.js module/project directory. In my … Read more

Associated Simple Product Price in Cart: Magento Extension [FREE]

Associated Product Price in Cart is a FREE Magento extension that uses the associated simple product’s price in shopping cart instead of the configurable product’s price. This module is compatible with Magento version 1.5 and later (Magento 1.5, 1.6, 1.7, 1.8, 1.9). Sometime, you have a scenario when a configurable product and its associated simple … Read more

Magento 2: [InvalidArgumentException] There are no commands defined in the “setup” namespace

I am getting the following error while adding a new module to my Magento 2 installation and running the command on terminal php bin/magento setup:upgrade. [InvalidArgumentException] There are no commands defined in the “setup” namespace The same kind of error will be displayed in terminal when I try to run other commands like php bin/magento … Read more

Magento 2: Get Controller, Module, Action & Route Name

This article shows how we can get name of the current module, controller name, action name and route name in Magento 2. Using Dependency Injection (DI) Below is a block class of my custom module (Chapagain_HelloWorld). I have injected object of \Magento\Framework\App\Request\Http class in the constructor of my module’s block class. app/code/Chapagain/HelloWorld/Block/HelloWorld.php <?php namespace Chapagain\HelloWorld\Block; … Read more

Magento 2: Simple Hello World Module – Step-by-Step Beginner Tutorial

This beginner step-by-step tutorial shows how you can create a simple and basic HelloWorld module / extension in Magento 2. The necessary files are listed with the code. This module just calls a block function in template file to print Hello World text. GitHub Repository of the Module: https://github.com/chapagain/simple-helloworld-magento2 Things to note: In Magento 2, … Read more

Magento 2: Check if a module is installed, enabled or active

This article shows how we can check if a module is installed / enabled or active in Magento 2. Both Dependency Injection and Object Manager ways are shown below. Using Dependency Injection (DI) Below is a block class of my custom module (Chapagain_HelloWorld). I have injected object of \Magento\Framework\Module\Manager class in the constructor of my … Read more

Joomla: Show Module inside Article

Sometime you might need to show any module’s content inside your article. For example, you have installed a image slideshow module. Now, you might need to show the image slideshow within your article page. For this purpose, Joomla CMS comes with the default plugin (Content – Load Modules) to show module’s content in any article. … Read more