In Magento 2, When a customer logs in to their account on an e-commerce website, they expect a smooth and seamless experience. Instead of being redirected to the default account dashboard, sending them back to the previous page they were browsing before logging in provides a better user experience. It saves time and effort for the user and ensures they can continue their shopping journey seamlessly.
Configuring the Redirect Settings
Step 1: Log in to the Magento 2 Admin Panel.
Step 2: Go to Stores > Configuration.
Step 3: Under Customers, select Customer Configuration.
Step 4: In the Login Options section, set “Redirect Customer to Account Dashboard after Logging in” to “No.“
Step 5: Save the configuration.
That’s it, Now, execute the flush command
php bin/magento cache:flush and you will be able to redirect customers to the previous page after login.
Thank you for reading my Article! Feel free to share your thoughts or ask any questions in the comments section below and spread the word by sharing. Your engagement is appreciated!