Magento 2 install with baseUrl “http://localhost”: Can't add product to the cart in ChromeMagento 2: After upgrading Checkout page Shows Blank & Minicart to 0Magento 2 - Weird behavior during checkoutadd to cart not working localhost Only in chrome (Magento 2 fresh install )Magento 2 Customers can't login and add product to cartMagento 2 installation from GitHub: blank screenCan't install sampledata with Magento 2.1.3Can't add product to cartError loading Magento in localhost after install a new template (solved)Localhost install Theme. Problem with 'bin'Magento 2 How to add configurable product to cart in product view page?Magento 2 install error on localhost
Cooking Scrambled Eggs ends up with excess liquid
Is this password scheme legit?
Are strlen optimizations really needed in glibc?
The term Feed-forward and its meaning?
Did ancient peoples ever hide their treasure behind puzzles?
Why did James Cameron decide to give Alita big eyes?
rationalizing sieges in a modern/near-future setting
Why are flat priors said to be proportional to a constant?
How can I download a file from a host I can only SSH to through another host?
Would Epic Heroism be an acceptable rule variant for a small, first-time group playing the Lost Mine of Phandelver adventure?
What to do about my 1-month-old boy peeing through diapers?
Does trying to charm an uncharmable creature cost a spell slot?
Should I use the words "pyromancy" and "necromancy" even if they don't mean what people think they do?
Etymology of "Talo" (Finnish for "house"). Can it be a cognate of Thalamus?
What is the 3D printer filament (or pellet) most resistant to bending at high heats?
Why was this commercial plane highly delayed mid-flight?
GDPR: What happens to deleted contacts re-entered through imports
What's the point of fighting monsters in Zelda BoTW?
Why does this London Underground poster from 1924 have a Star of David atop a Christmas tree?
How do we improve collaboration with problematic tester team?
Can I get a PhD for developing an educational software?
Pen test results for web application include a file from a forbidden directory that is not even used or referenced
Is the Amazon rainforest the "world's lungs"?
Force SQL Server to use fragmented indexes?
Magento 2 install with baseUrl “http://localhost”: Can't add product to the cart in Chrome
Magento 2: After upgrading Checkout page Shows Blank & Minicart to 0Magento 2 - Weird behavior during checkoutadd to cart not working localhost Only in chrome (Magento 2 fresh install )Magento 2 Customers can't login and add product to cartMagento 2 installation from GitHub: blank screenCan't install sampledata with Magento 2.1.3Can't add product to cartError loading Magento in localhost after install a new template (solved)Localhost install Theme. Problem with 'bin'Magento 2 How to add configurable product to cart in product view page?Magento 2 install error on localhost
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Today I've created a vanilla installation of Magento 2:
- Magento CE 2.0.3
- Vagrant
- Ubuntu 14.04
- PHP 7.0.3
- MySQL 5.6.28
- URL: http://localhost/
Out of the box, when I try to add a product to the cart in Chrome it doesn't work:
- The cart changes to a spinner icon
- The text on my button changes to 'Adding...'
- That's it ...
The same goes for reviews. When I try to add a review, it doesn't work.
However... when I try it in Firefox it works!
Can anyone tell me why it isn't working in Chrome?
magento2 base-url localhost
add a comment |
Today I've created a vanilla installation of Magento 2:
- Magento CE 2.0.3
- Vagrant
- Ubuntu 14.04
- PHP 7.0.3
- MySQL 5.6.28
- URL: http://localhost/
Out of the box, when I try to add a product to the cart in Chrome it doesn't work:
- The cart changes to a spinner icon
- The text on my button changes to 'Adding...'
- That's it ...
The same goes for reviews. When I try to add a review, it doesn't work.
However... when I try it in Firefox it works!
Can anyone tell me why it isn't working in Chrome?
magento2 base-url localhost
add a comment |
Today I've created a vanilla installation of Magento 2:
- Magento CE 2.0.3
- Vagrant
- Ubuntu 14.04
- PHP 7.0.3
- MySQL 5.6.28
- URL: http://localhost/
Out of the box, when I try to add a product to the cart in Chrome it doesn't work:
- The cart changes to a spinner icon
- The text on my button changes to 'Adding...'
- That's it ...
The same goes for reviews. When I try to add a review, it doesn't work.
However... when I try it in Firefox it works!
Can anyone tell me why it isn't working in Chrome?
magento2 base-url localhost
Today I've created a vanilla installation of Magento 2:
- Magento CE 2.0.3
- Vagrant
- Ubuntu 14.04
- PHP 7.0.3
- MySQL 5.6.28
- URL: http://localhost/
Out of the box, when I try to add a product to the cart in Chrome it doesn't work:
- The cart changes to a spinner icon
- The text on my button changes to 'Adding...'
- That's it ...
The same goes for reviews. When I try to add a review, it doesn't work.
However... when I try it in Firefox it works!
Can anyone tell me why it isn't working in Chrome?
magento2 base-url localhost
magento2 base-url localhost
edited Feb 10 '16 at 21:35
Arkadii Chyzhov
2,5287 silver badges14 bronze badges
2,5287 silver badges14 bronze badges
asked Feb 10 '16 at 15:48
Giel BerkersGiel Berkers
7,5543 gold badges45 silver badges88 bronze badges
7,5543 gold badges45 silver badges88 bronze badges
add a comment |
add a comment |
6 Answers
6
active
oldest
votes
Just figured it out! Apparently Chrome doesn't play nice with cookies when they are single-level domain (like localhost). Changing my environment to localhost.dev and mapping it in my hosts-file and changing the configuration of Magento 2 solved this problem!
I'll leave this answer here to save other people hours of debugging and mashing their head on their keyboard.
1
THIS! Please read detailed explaination here: alankent.me/2015/04/25/…
– Maddy
Feb 10 '16 at 15:57
good comment @Maddy. I also heard of problems with local dev domains
– David Verholen
Feb 10 '16 at 21:37
add a comment |
I face same problem which is mention above,
I change localhost to 127.0.0.1 and problem was resolved
add a comment |
Those who don't wish to change the localhost url and doesn't want to add vhost for this problem. Here's the quick fix.
The problem is due to form_key mismatch. The form key which gets posted during add to cart action is getting mismatched with store session form key.
Go to
vendor/magento/module-checkout/Controller/Cart/Add.php execute()
method.
and comment out the first If condition.
**NOTE:**This is not a recommended solution for Production environment.
add a comment |
- Please change
localhostto127.0.0.1, - To change directly from database Goto ->
core_config_datatable - Then change secure and unsecure base url
http://localhost/ to http://127.0.0.1
add a comment |
Infact, this is not a Magento issue, it’s that web browsers behave differently when used with a domain name like "localhost" with less than 2 dots in it. In this case the cookies are not saved and hence creates problem.
For this I suggest you to use one of two given solutions :
- Either use 127.0.0.1 OR your ip address as domain during installation or replace localhost to 127.0.0.1 OR your ip address from base url from database
UPDATE core_config_data SET value = 'http://127.0.0.1/' WHERE path LIKE 'web/unsecure/base_url';
UPDATE core_config_data SET value = 'https://127.0.0.1/' WHERE path LIKE 'web/secure/base_url';
- Or use virtual hosts from /etc/hosts in linux and C:WINDOWSSystem32driversetchosts in windows.
For eg : Add below code at the last line of your host file where "project.dev" is your new domain name.
127.0.0.1 project.dev
add a comment |
Try updating the apache2.conf file.
- Open and edit the file
/etc/apache2/apache2.conf - Navigate to the place in the apache2.conf file
<Directory /var/www/> - Change
"AllowOverride None"to"AllowOverride All" - Save the file
- Restart apache2 by
sudo service apache2 restart
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f101257%2fmagento-2-install-with-baseurl-http-localhost-cant-add-product-to-the-cart%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
Just figured it out! Apparently Chrome doesn't play nice with cookies when they are single-level domain (like localhost). Changing my environment to localhost.dev and mapping it in my hosts-file and changing the configuration of Magento 2 solved this problem!
I'll leave this answer here to save other people hours of debugging and mashing their head on their keyboard.
1
THIS! Please read detailed explaination here: alankent.me/2015/04/25/…
– Maddy
Feb 10 '16 at 15:57
good comment @Maddy. I also heard of problems with local dev domains
– David Verholen
Feb 10 '16 at 21:37
add a comment |
Just figured it out! Apparently Chrome doesn't play nice with cookies when they are single-level domain (like localhost). Changing my environment to localhost.dev and mapping it in my hosts-file and changing the configuration of Magento 2 solved this problem!
I'll leave this answer here to save other people hours of debugging and mashing their head on their keyboard.
1
THIS! Please read detailed explaination here: alankent.me/2015/04/25/…
– Maddy
Feb 10 '16 at 15:57
good comment @Maddy. I also heard of problems with local dev domains
– David Verholen
Feb 10 '16 at 21:37
add a comment |
Just figured it out! Apparently Chrome doesn't play nice with cookies when they are single-level domain (like localhost). Changing my environment to localhost.dev and mapping it in my hosts-file and changing the configuration of Magento 2 solved this problem!
I'll leave this answer here to save other people hours of debugging and mashing their head on their keyboard.
Just figured it out! Apparently Chrome doesn't play nice with cookies when they are single-level domain (like localhost). Changing my environment to localhost.dev and mapping it in my hosts-file and changing the configuration of Magento 2 solved this problem!
I'll leave this answer here to save other people hours of debugging and mashing their head on their keyboard.
answered Feb 10 '16 at 15:56
Giel BerkersGiel Berkers
7,5543 gold badges45 silver badges88 bronze badges
7,5543 gold badges45 silver badges88 bronze badges
1
THIS! Please read detailed explaination here: alankent.me/2015/04/25/…
– Maddy
Feb 10 '16 at 15:57
good comment @Maddy. I also heard of problems with local dev domains
– David Verholen
Feb 10 '16 at 21:37
add a comment |
1
THIS! Please read detailed explaination here: alankent.me/2015/04/25/…
– Maddy
Feb 10 '16 at 15:57
good comment @Maddy. I also heard of problems with local dev domains
– David Verholen
Feb 10 '16 at 21:37
1
1
THIS! Please read detailed explaination here: alankent.me/2015/04/25/…
– Maddy
Feb 10 '16 at 15:57
THIS! Please read detailed explaination here: alankent.me/2015/04/25/…
– Maddy
Feb 10 '16 at 15:57
good comment @Maddy. I also heard of problems with local dev domains
– David Verholen
Feb 10 '16 at 21:37
good comment @Maddy. I also heard of problems with local dev domains
– David Verholen
Feb 10 '16 at 21:37
add a comment |
I face same problem which is mention above,
I change localhost to 127.0.0.1 and problem was resolved
add a comment |
I face same problem which is mention above,
I change localhost to 127.0.0.1 and problem was resolved
add a comment |
I face same problem which is mention above,
I change localhost to 127.0.0.1 and problem was resolved
I face same problem which is mention above,
I change localhost to 127.0.0.1 and problem was resolved
edited May 27 '16 at 8:52
Marius♦
172k30 gold badges334 silver badges709 bronze badges
172k30 gold badges334 silver badges709 bronze badges
answered May 27 '16 at 7:51
Azhar ShaikhAzhar Shaikh
262 bronze badges
262 bronze badges
add a comment |
add a comment |
Those who don't wish to change the localhost url and doesn't want to add vhost for this problem. Here's the quick fix.
The problem is due to form_key mismatch. The form key which gets posted during add to cart action is getting mismatched with store session form key.
Go to
vendor/magento/module-checkout/Controller/Cart/Add.php execute()
method.
and comment out the first If condition.
**NOTE:**This is not a recommended solution for Production environment.
add a comment |
Those who don't wish to change the localhost url and doesn't want to add vhost for this problem. Here's the quick fix.
The problem is due to form_key mismatch. The form key which gets posted during add to cart action is getting mismatched with store session form key.
Go to
vendor/magento/module-checkout/Controller/Cart/Add.php execute()
method.
and comment out the first If condition.
**NOTE:**This is not a recommended solution for Production environment.
add a comment |
Those who don't wish to change the localhost url and doesn't want to add vhost for this problem. Here's the quick fix.
The problem is due to form_key mismatch. The form key which gets posted during add to cart action is getting mismatched with store session form key.
Go to
vendor/magento/module-checkout/Controller/Cart/Add.php execute()
method.
and comment out the first If condition.
**NOTE:**This is not a recommended solution for Production environment.
Those who don't wish to change the localhost url and doesn't want to add vhost for this problem. Here's the quick fix.
The problem is due to form_key mismatch. The form key which gets posted during add to cart action is getting mismatched with store session form key.
Go to
vendor/magento/module-checkout/Controller/Cart/Add.php execute()
method.
and comment out the first If condition.
**NOTE:**This is not a recommended solution for Production environment.
answered Mar 31 '17 at 8:08
FrancFranc
4397 silver badges16 bronze badges
4397 silver badges16 bronze badges
add a comment |
add a comment |
- Please change
localhostto127.0.0.1, - To change directly from database Goto ->
core_config_datatable - Then change secure and unsecure base url
http://localhost/ to http://127.0.0.1
add a comment |
- Please change
localhostto127.0.0.1, - To change directly from database Goto ->
core_config_datatable - Then change secure and unsecure base url
http://localhost/ to http://127.0.0.1
add a comment |
- Please change
localhostto127.0.0.1, - To change directly from database Goto ->
core_config_datatable - Then change secure and unsecure base url
http://localhost/ to http://127.0.0.1
- Please change
localhostto127.0.0.1, - To change directly from database Goto ->
core_config_datatable - Then change secure and unsecure base url
http://localhost/ to http://127.0.0.1
edited May 18 '17 at 5:53
Teja Bhagavan Kollepara
3,0504 gold badges21 silver badges51 bronze badges
3,0504 gold badges21 silver badges51 bronze badges
answered Mar 16 '17 at 10:45
Sheshgiri AnvekarSheshgiri Anvekar
7517 silver badges20 bronze badges
7517 silver badges20 bronze badges
add a comment |
add a comment |
Infact, this is not a Magento issue, it’s that web browsers behave differently when used with a domain name like "localhost" with less than 2 dots in it. In this case the cookies are not saved and hence creates problem.
For this I suggest you to use one of two given solutions :
- Either use 127.0.0.1 OR your ip address as domain during installation or replace localhost to 127.0.0.1 OR your ip address from base url from database
UPDATE core_config_data SET value = 'http://127.0.0.1/' WHERE path LIKE 'web/unsecure/base_url';
UPDATE core_config_data SET value = 'https://127.0.0.1/' WHERE path LIKE 'web/secure/base_url';
- Or use virtual hosts from /etc/hosts in linux and C:WINDOWSSystem32driversetchosts in windows.
For eg : Add below code at the last line of your host file where "project.dev" is your new domain name.
127.0.0.1 project.dev
add a comment |
Infact, this is not a Magento issue, it’s that web browsers behave differently when used with a domain name like "localhost" with less than 2 dots in it. In this case the cookies are not saved and hence creates problem.
For this I suggest you to use one of two given solutions :
- Either use 127.0.0.1 OR your ip address as domain during installation or replace localhost to 127.0.0.1 OR your ip address from base url from database
UPDATE core_config_data SET value = 'http://127.0.0.1/' WHERE path LIKE 'web/unsecure/base_url';
UPDATE core_config_data SET value = 'https://127.0.0.1/' WHERE path LIKE 'web/secure/base_url';
- Or use virtual hosts from /etc/hosts in linux and C:WINDOWSSystem32driversetchosts in windows.
For eg : Add below code at the last line of your host file where "project.dev" is your new domain name.
127.0.0.1 project.dev
add a comment |
Infact, this is not a Magento issue, it’s that web browsers behave differently when used with a domain name like "localhost" with less than 2 dots in it. In this case the cookies are not saved and hence creates problem.
For this I suggest you to use one of two given solutions :
- Either use 127.0.0.1 OR your ip address as domain during installation or replace localhost to 127.0.0.1 OR your ip address from base url from database
UPDATE core_config_data SET value = 'http://127.0.0.1/' WHERE path LIKE 'web/unsecure/base_url';
UPDATE core_config_data SET value = 'https://127.0.0.1/' WHERE path LIKE 'web/secure/base_url';
- Or use virtual hosts from /etc/hosts in linux and C:WINDOWSSystem32driversetchosts in windows.
For eg : Add below code at the last line of your host file where "project.dev" is your new domain name.
127.0.0.1 project.dev
Infact, this is not a Magento issue, it’s that web browsers behave differently when used with a domain name like "localhost" with less than 2 dots in it. In this case the cookies are not saved and hence creates problem.
For this I suggest you to use one of two given solutions :
- Either use 127.0.0.1 OR your ip address as domain during installation or replace localhost to 127.0.0.1 OR your ip address from base url from database
UPDATE core_config_data SET value = 'http://127.0.0.1/' WHERE path LIKE 'web/unsecure/base_url';
UPDATE core_config_data SET value = 'https://127.0.0.1/' WHERE path LIKE 'web/secure/base_url';
- Or use virtual hosts from /etc/hosts in linux and C:WINDOWSSystem32driversetchosts in windows.
For eg : Add below code at the last line of your host file where "project.dev" is your new domain name.
127.0.0.1 project.dev
answered May 18 '17 at 6:31
sagar sapkotasagar sapkota
4311 gold badge4 silver badges16 bronze badges
4311 gold badge4 silver badges16 bronze badges
add a comment |
add a comment |
Try updating the apache2.conf file.
- Open and edit the file
/etc/apache2/apache2.conf - Navigate to the place in the apache2.conf file
<Directory /var/www/> - Change
"AllowOverride None"to"AllowOverride All" - Save the file
- Restart apache2 by
sudo service apache2 restart
add a comment |
Try updating the apache2.conf file.
- Open and edit the file
/etc/apache2/apache2.conf - Navigate to the place in the apache2.conf file
<Directory /var/www/> - Change
"AllowOverride None"to"AllowOverride All" - Save the file
- Restart apache2 by
sudo service apache2 restart
add a comment |
Try updating the apache2.conf file.
- Open and edit the file
/etc/apache2/apache2.conf - Navigate to the place in the apache2.conf file
<Directory /var/www/> - Change
"AllowOverride None"to"AllowOverride All" - Save the file
- Restart apache2 by
sudo service apache2 restart
Try updating the apache2.conf file.
- Open and edit the file
/etc/apache2/apache2.conf - Navigate to the place in the apache2.conf file
<Directory /var/www/> - Change
"AllowOverride None"to"AllowOverride All" - Save the file
- Restart apache2 by
sudo service apache2 restart
answered Aug 15 at 5:34
Kazim NooraniKazim Noorani
1,2841 gold badge8 silver badges24 bronze badges
1,2841 gold badge8 silver badges24 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f101257%2fmagento-2-install-with-baseurl-http-localhost-cant-add-product-to-the-cart%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown