Loading...

How to add customer last logged in column customer grid in Magento 2?

Jayram Prajapati  ·   13 Oct 2022
How to add customer last logged in column customer grid in Magento 2?
service-banner

Introduction

Magento Customer Grid Customisation is very handy.

Follow the steps to customize the Customer Grid in Magento 2 and add the Customer's last logged-in date.

Step 1 :

app/code/Elightwalk/CustomerGrid/registration.php  1

php

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
   \Magento\Framework\Component\ComponentRegistrar::MODULE,
   'Elightwalk_CustomerGrid',
   __DIR__
);

Step 2:

app/code/Elightwalk/CustomerGrid/etc/module.xml

xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
   <module name="Elightwalk_CustomerGrid" setup_version="1.0.0">
       <sequence>
           <module name="Magento_Customer"/>
       </sequence>
   </module>
</config>

Step 3 :

app/code/Elightwalk/CustomerGrid/view/adminhtml/ui_component/customer_listing.xml

xml