How to Redirect to Previous Page URL in Magento 2

How to Redirect to Previous Page URL in Magento 2

Working with client’s projects get us through lots of new challenges, requirements, implementations and ultimately outperform for the successful project completion. Recently working with such a client, we got a requirement to redirect customers to the previous page from one page checkout. For implementation, we develop custom code which helped to fulfill the requirement.

Custom code to Redirect to Previous Page URL in Magento 2

jQuery("[selector]").click(function(e) {
	
	
	window.location.href = '';

});

If you find such an requirement ever to redirect customers to previous page URL, above code will definitely help you. Let me know in which case you implemented the solution above or give me a holler if need any assistance. I really wish to have feedback and suggestions in my comment section.

Previous Article

How to Create Tax Rules Programmatically in Magento 2

Next Article

How to Override Configurable Product Price with Simple Product Price in Magento

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Get Connect With Us

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨