When I clicked on add to cart or add product in wishlist then showing error as below:
How can I fix this issue ? Where is the form key to change or what can I do ?
When I clicked on add to cart or add product in wishlist then showing error as below:
How can I fix this issue ? Where is the form key to change or what can I do ?
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 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
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:
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.