How to Enable Google Analytics in Magento 2

Here are all steps for you to know How to Enable Google Analytics in Magento 2 : Step 1: Create Google Analytics Account Step 2: Obtain a tracking ID Step 3: Configure the Google API in Magento 2 Step 1: Create Google Analytics Account Go to this link to create an account: https://www.google.com/analytics/ Select Sign in with […]

Read More

How to Insert JS, CSS or Less with Your Module in Magento 2

Insert JS, CSS or Less with Your Module in Magento 2 . If you want to insert to all pages: Create the file default.xml in view/frontend/layout inside your module folder

If you want to achieve on specific page, for instance, product page, you need to build create view/frontend/ layout/ catalog_product_view.xml respectively inside your custom module […]

Read More

How to Reload Ui Component Grid Table with Js

In this topic We will show you how to reload Ui component grid table with js. Step 1: Create UI component grid with xml file. Step 2: Write reload function with js. Magento 2 provide Ui component to create grid table in admin. It’s make the grid is easy to use and more comfortable for […]

Read More

How to Create Auto Update Time Attributes in InstallSchema of Magento 2

  Mysql provides the automatic initialization and updating to the current date and time for TIMESTAMP and DATETIME types. When you insert or update a row into data table, these fields will be updated automatically by the current time. So you do not need to set the value of these fields in your PHP code. […]

Read More

How to Show Listing Items ( Grid ) on The Form in Magento 2

In the admin page, sometime we want to show a listing item beside the inputs in a form. Example, you want to show related product of a product on the product editing page. However, core magento uses the data provider to modify meta, it is quite complicate. We will learn it in the future. Today, […]

Read More

Practical Way of Using VirtualType in Magento 2

  Let’s learn how to do Practical Way of Using VirtualType in Magento 2 Hi everyone, sometimes you are in a situation when you need to use a class, for example the Sales Order grid collection (Magento\Sales\Model\ResourceModel\Order\Grid\Collection) (sales_order_grid UI Component) But you need to use a different value for a parameter, for example, you want to […]

Read More

How to Add New Total to Email in Magento 2

In this topic we will show you How to Add New Total to Email in Magento 2 through 2 steps: Step 1: Create the file: sales_email_order_items.xml Step 2: Create the block new.order.totals Hello everyone! In Magento 2, you can add new total to block total of email when sending the email. In this blog, I […]

Read More

How to Create Module Route in Magento 2

In this topic we will show you How to create module route in Magento 2 and route’s feature : Step 1: Frontend Route Step 2: Admin Route Step 3: Use Route to rewrite controller In magento 2, route is module name in browser url. The url format is: http://yoursite.com/index.php/[route_name]/[controller_name]/[action_name] Example: http://yoursite.com/index.php/customer/account/login We can define route […]

Read More

How to Create Multiple Layers of Modal in Magento 2

In this topic we will show you How to Create Multiple Layers of Modal in Magento 2 through 2 steps: Step 1 : Create your first Modal layer Step 2: Create the second Modal layer In Magento 2, occasionally you will see something like this: This type of UX is called Modal. It allows users to […]

Read More

How to Write Unit Test in Magento 2 (Part 1)

In this topic we will show you How to Write Unit Test in Magento 2 (Part 1) through 5 steps: Step 1: Create module Magestore_HelloMagento Step 2: Create Model HelloMessage.php Step 3: Create UnitTest Model Step 4: Add the UnitTest to the Test Suite Step 5: Run UnitTest Magento 2 has pre-installed PHPUnit, an automated testing […]

Read More