Categories: How To

How to Fix Magento Form Key Auto Disable Issue at Checkout Page

Regularly updating your Magento stores brings not only the newest features, but also provides security fixes, which is highly important for your Magento store’s safety. Not updating your Magento stores can result in not only a bad performance, but it makes your shop an easy target for hackers. That’s we always recommended store owners to keep their Magento stores up to date with new security patches and using MageComp Upgrade Service will help you to install latest Magento patch without zero data loss and zero downtime. Meanwhile upgrading one Magento store to Magento CE 1.9.3.x along with SUPEE-9767, we came across an issue of Checkout is not working due to Form Key Validation enabled from admin backend.

Go to System > Configuration > Advanced > Security > Enable Form Key Validation on Checkout

On checkout page, when we select any payment method, we are unable to move further to complete the checkout process or even it doesn’t display any error or response just because enable the form key feature but when we have disabled Form Key Validation at Checkout, the checkout process functions as expected.

While working on the issue in developer console, we found that CSS is adding the disabled selector to the form_key. it means a form_key value is not getting submitted to checkout controller causing the controller to return null. That’s why we need to pass form_key to checkout controller using following line.

To resolve the issue, need to add a small script to payment.phtml file available on below location.
app\design\frontend\[YOUR THEME]\template\checkout\onepage\payment.phtml

 

That’s it, now your form_key is passed to checkout controller each and every time you proceed to order product. So, what else needed for the store owner, if their store works smoothly without any issue.
Get in touch with us for more update and comment down below if you are looking for any help regarding this code.

Happy Fixing !

Click to rate this post!
[Total: 3 Average: 5]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate 🎖️ Certified Magento Developer👨‍💻. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.🏏

Recent Posts

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

20 hours ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

3 days ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

3 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

4 days ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

5 days ago

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

1 week ago