magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.52k stars 9.31k forks source link

Add to Cart and Checkout Issue #6917

Closed nomuprive closed 8 years ago

nomuprive commented 8 years ago

Magento 2.1.1 PHP Version: 5.6.17 MySQL Version: 5.6.33

When Does Issue Occur:

When click on "Add to Cart" button it redirects to an error page with error message, "The page isn’t redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete. This problem can sometimes be caused by disabling or refusing to accept cookies."

The issue is not only occurring in FireFox, but in all other browsers I tried it with.

What Is Already Done:

Ran compilation, re-indexed, cleared cache, checked files and folders permission to make sure all is well, but none of the above fixed the issue.

Thanks!

veloraven commented 8 years ago

@williambize thank you for your feedback. Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.

nomuprive commented 8 years ago

Magento 2.1.1 PHP Version: 5.6.17 MySQL Version: 5.6.33

Preconditions

  1. Magento CE 2.1.1 without sample data is installed and in production mode.
  2. Store is completely set up, designed and in production mode
  3. BrainTree payment method is set up.
  4. Categories and products are created.
  5. Everything seems to work fine; except "Add to Cart" or checkout

Steps to reproduce

  1. Navigate to storefront as a guest.
  2. Click "Add to Cart" to add product to cart.

Actual and Expected result

Expected result: Order is placed successfully, customer is redirected to the success page.

Actual result: The page isn’t redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

Additional information

I have tried it in all browsers and got the same error result

NOTE: It's a multi-store

BangEnergy commented 8 years ago

I had a similar issue and turning on all the magento cache solved the issue me. Previously there were some cache on and some off.

nomuprive commented 8 years ago

@305david Thanks for the suggestion. I just double checked the Cache Management in the Admin, I have all the cache enabled under Cache Management. So I doubt if that is the cause in my situation. Screenshot here http://prntscr.com/ctxikj

SerhiyShkolyarenko commented 8 years ago

@williambize Let's do it step-by-step for v2.1.2

  1. I created a category and a product
  2. i created additional store and store view,
  3. ran sudo -H -u www-data ./bin/magento deploy:mode:set production for production mode
...
New version of deployed files: 1476894114
Deployment of static content complete
Disabled maintenance mode
Enabled production mode.
  1. Cleaned browser cookies, localStorage and cache.
  2. Added product to cart on the default store view. Successfully. Does this scenario works for you? What is the way to reproduce the issue?
nomuprive commented 8 years ago

@SerhiyShkolyarenko can I send you the store URL in a private mode or email? It does not work for me.

Thanks!

nomuprive commented 8 years ago

Hi @SerhiyShkolyarenko. I think the issue is that normally when you click on "Add to Cart", it should add the product and redirect to Shopping Cart page, but it tries redirecting to homepage instead so that's why the browsers keep saying...

"The page isn’t redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies."

Note: I have tried all browsers and get the same kind of message. "The page isn’t redirecting properly"

Note: I have tried all browsers and get the same kind of message.

SerhiyShkolyarenko commented 8 years ago

@williambize please, send me your URL and a dump of your DB for reproducing on my local machine.

nomuprive commented 8 years ago

@SerhiyShkolyarenko I just sent you the database dump via email. Thanks!

SerhiyShkolyarenko commented 8 years ago

@williambize looks like the issue root is in your theme. Your dump didn't work for me with your value of design/theme/theme_id(table core_config_data), I changed id to 1, went to product page and added it to cart successfully. Is the issue reproducible for you on clean magento installation?

nomuprive commented 8 years ago

@SerhiyShkolyarenko I reply via email but didn't hear back from you so I will add my reply here...

I did try changing the theme before and didn't see any change. But when you mentioned that again, I tried it one more time by switching to Luma the Magento default theme and click on "Add to Cart". It redirected to cart page, but the product was not added to the cart. So I doubt if the issue is with the theme.

Thanks!

SerhiyShkolyarenko commented 8 years ago

@williambize as far as behaviour changed to the opposite and cannot be reproduced on the clean Mangento 2, we close this issue. Adding to cart was successful on my instance v2.1.2. Please create a new issue if you manage to reproduce it on the clean installation without code changes.

nomuprive commented 7 years ago

@SerhiyShkolyarenko Hi, and thanks for the support! The theme developer/ designer tested the store with Luma and got the error just as I did. The "Add to Cart" is redirecting to homepage causing a loop and checkout never complete. If the issue happens with Luma which is Magento 2 default theme then I don't think the theme is the cause of the issue.

SerhiyShkolyarenko commented 7 years ago

@williambize please confirm that the issue is reproducible for you on the latest develop branch or release 2.1.2 when you install Magento without any code changes to absolutely clean database. Is the issue reproducible when you don't enable Braintree?

nomuprive commented 7 years ago

@SerhiyShkolyarenko The issue persist with or without BrainTree. I tested the store with Luma and got the same issue; even set the ID to 0 and still got the same issue (Add to Cart is redirecting to homepage instead of cart page or checkout causing a loop). At this point I think is a Magento 2 bug unless proven differently. I'm wondering how the "Add to Cart" and checkout worked for you in Luma, but is not working for me even in different browsers.

SerhiyShkolyarenko commented 7 years ago

@williambize thank you for clarifying it's not dependent on Braintree. To reopen the issue I still need your confirmation that it's reproducible on absolutely clean installation. Generally, adding to cart is very basic flow and it's tested several hundred times before the release.