How to enable Login as Customer Settings in Magento 2.4?

From Magento 2.4, New Feature with Out of the box called a login as Customer.

This feature is useful for store administrators only. Store admin can access customer’s order history, check wishlist items, and customer-related information from the frontend by login behalf of the customer when they click on login as the customer button from the admin panel. Continue reading “How to enable Login as Customer Settings in Magento 2.4?”

How to remove extra column from database table using Magento 2?

In Magento 2 Sometimes we have added an extra column in the table for extended functionality in module and in future, we have removed that functionality so we need to remove extra column field from a database table.

I have added one field name gst in sales_order table and I want to remove extra field from table in future. You can remove field using dropColumn() in UpgradeSchema.php file.
Using below code snippet you can remove already existed column field from table.

Upgrade the setup_version number of module from module.xml file. An older version number is 1.0.1 so I have added new version 1.0.2 in module.xml file

Path: Magento22/app/code/Rbj/Training/etc/module.xml

Create UpgradeSchema.php file under Setup folder in your module.
Path: Magento22/app/code/Rbj/Training/Setup/UpgradeSchema.php

Run command from root directory of your project,
php bin/magento setup:upgrade

If you want to add the field in table  Add New Field in Database Table Magento 2
If you want to rename/change column field name, Refer link Rename Column name in Table Magento 2

A Complete List of all events in Magento 2

Magento Comes with a list of events Out-of-the-box to provide an event-observer approach for eCommerce development.

You can use any required events from the Core module to accomplish your requirements. Define events in events.xml file, Create observer.php file to do specific action for an event.

You can also create your own custom event to accomplish your task by link, Create Custom Events. Continue reading “A Complete List of all events in Magento 2”