Magento 2 fix can’t add product to cart in localhost

koobitor
Medvine Tech
Published in
1 min readJul 3, 2017

Change your base URL from localhost to 127.0.0.1.

Using localhost as the domain in your base URL causes problems in Magento 2.

Magento’s base URL configuration is located in the core_config_data table. The following values may need to be changed:

  • web/unsecure/base_url
  • web/secure/base_url

For example, if you previously had http://localhost/magento2community/, you should change it to http://127.0.0.1/magento2community/

After changing the url, flush the cache (bin/magento cache:flush). You might also need to clear out your var directories.

Ref : https://magento.stackexchange.com/questions/105042/add-to-cart-not-working-localhost-only-in-chrome-magento-2-fresh-install

--

--

koobitor
Medvine Tech

Developer love to share. Like the open source. Listen and play musics. ^^