0

When I clicked on add to cart or add product in wishlist then showing error as below:

enter image description here

How can I fix this issue ? Where is the form key to change or what can I do ?

4
  • follow this link: magento.stackexchange.com/questions/160829/…. Commented Dec 13, 2019 at 10:59
  • Is it live or localhost ? @RK7002 Commented Dec 13, 2019 at 11:01
  • it is localhost Commented Dec 13, 2019 at 11:06
  • i have updated my ans implement it now and let me know about the outcome Commented Dec 13, 2019 at 11:12

3 Answers 3

2

Change your baseurl from http://localhost/ to http://127.0.0.1/.

From Admin Panel :

Stores > Settings > Configuration > General > Web

Change Base URLs & Secure Base URL (Secure)

Using command line :

Use SSH

mysql -u $database_user -p $database_name 

Access the database

use database select * from core_config_data where path like '%base%url%'; 

Update Base Url :

update core_config_data set value = 'http://example.com/' where path = 'web/unsecure/base_url'; update core_config_data set value = 'https://example.com/' where path = 'web/secure/base_url'; 

Clean cache:

php bin/magento cache:clean 
0

go to your env.php file and set the base url from localhost to 127.0.0.1 location for env.php file is <magento root directory>app\etc

and then go to you php.ini file and look for this line max_input_var=100000 now just flush:cache and you are done

2
  • max_input_vars search this and update the value Commented Dec 13, 2019 at 11:07
  • I have done changes as you suggest but still I'm facing same error Commented Dec 13, 2019 at 11:14
0

I had the same problem with magento 2.3, where Add to Cart button refreshed the page instead of adding anything in cart. where as website was working properly in Private Browsing on a custom theme.

Solutions Didn't Worked:

  • Change max_input_var=10000
  • max_input_time = 600
  • max_execution_time = 3600
  • Flush cache

Solution Worked for me:

In Configuration >> Web, I:

I am not sure if its a reliable fix or a temporary, but it resolved the issue for now.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.