Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minicart shows no product even when I have products in cart #4010

Closed
jaimestuardo opened this issue Apr 5, 2016 · 21 comments
Closed

Minicart shows no product even when I have products in cart #4010

jaimestuardo opened this issue Apr 5, 2016 · 21 comments

Comments

@jaimestuardo
Copy link

Sometimes, when I have products in cart, this is shown:

image

Then, I add 1 product, and the minicart started to show this new added product together with the old products in cart:

image

Regards
Jaime

@ishakhsuvarov
Copy link
Contributor

@jaimestuardo Thank you for reporting this issue. Could you please provide more information on the steps to reproduce the issue? Which way did you add products which are not shown?

@jaimestuardo
Copy link
Author

I have found how to reproduce it.

  1. Disable purchase of guests
  2. Load frontend not logged in and add a product to shopping cart (just 1 of it)
  3. The product is added to mini cart
  4. Try to purchase. Shopping cart will be displayed telling that guest purchase is disabled
  5. Go to login page and authenticate (in this page, you will see a 1 in the minicart indicator)
  6. My account page will be loaded and the minicart indicator will be empty. If you click it, you will see that there is no product in cart.
  7. Add a new product (just 1 of it)
  8. Then, you will see 2 in the minicart indicator. If you click it, you will see the product just added besides the product you added before.

@sdzhepa
Copy link
Contributor

sdzhepa commented Apr 14, 2016

@jaimestuardo, We have tried, but could not reproduce this issue on the latest code from repo. (commit f93b8da).
We use next steps(based on Your comment)

Preconditions:

  • Latest Magento 2 version is installed
  • Allow Guest Checkout = No (STORES > Configuration > Sales > Checkout > Checkout Options)
    (!) All other Magento 2 settings in default state as after install
  • Simple product is created
  • Test customer is created(without any product in cart)

Steps to reproduce:

  • Go to Storefront as Guest
  • Add Simple product to cart
    Result: Product is added to cart, Mini cart has 1 Simple product. Red Icon with number 1 is presented near mini cart

Test flow #1:
1 Click "Go to Checkout" from mini cart
Result: Modal window with ability to Sign In or Create an Account is appeared
2 Sign In as customer from preconditions
Result: Customer is successfully logged in. Mini cart has 1 Simple product. Red Icon with number 1 is presented near mini cart
3 Add Simple product to cart again
Result: Two product is presented in Mini cart(Simple product, qty=2) Red Icon with number 2 is presented near mini cart

Test flow #2:
1 Click link 'Sign In' in the top of the page
Result: Page "Customer Login" is opened
2 Sign In as customer from preconditions
Result: My Account(My Dashboard) page is opened. Customer is successfully logged in. Mini cart has 1 Simple product. Red Icon with number 1 is presented near mini cart
3 Add Simple product to cart again
Result: Two product is presented in Mini cart(Simple product, qty=2) Red Icon with number 2 is presented near mini cart

Test flow #3:
1 Go to shopping cart page(link 'View and edit cart' from mini cart)
Result: Simple product with qty=2 is presented
2 Click "Proceed to Checkout" button(from Summary section)
Result: Modal window with ability to Sign In or Create an Account is appeared
3 Click "Create an Account" and create new customer
Result: New customer is created. My Account(My Dashboard) page is opened. Mini cart has 1 Simple product. Red Icon with number 1 is presented
4 Add Simple product to cart again
Result: Two product is presented in Mini cart(Simple product, qty=2) Red Icon with number 2 is presented near mini cart

Probably you are using not latest code base or need clarification in steps/preconditions etc.

@jksimoniii
Copy link

@jaimestuardo @sdzhepa @ishakhsuvarov

I am seeing the same issues on iOS devices

@jksimoniii
Copy link

jksimoniii commented Apr 14, 2016

I think we have drilled it down to an issue related to these lines of code in Magento_Checkout::cart/minicart.phtml. summary_count results in undefined on Safari iOS while 0 in other browsers

            <!-- ko if: cart().summary_count -->
                <!-- ko text: cart().summary_count --><!-- /ko -->
                <!-- ko i18n: 'items' --><!-- /ko -->
            <!-- /ko -->

@ishakhsuvarov
Copy link
Contributor

@jksimoniii Looks like you are using the installation from 2.0 branch. There is a fix for that in develop branch. Any chance you could verify that?

@jksimoniii
Copy link

@ishakhsuvarov Great, thanks! Looks like that will solve the problem we are having. Will this be wrapped in the 2.1 release ?

@ishakhsuvarov
Copy link
Contributor

@jksimoniii Yes, the fix should be included in the 2.1

@jaimestuardo
Copy link
Author

How can I solve the problem momentarily using version 2.0.4?

@jaimestuardo
Copy link
Author

I have updated to 2.0.6 and problem still exists.

@piotrekkaminski
Copy link
Contributor

@jaimestuardo can you check on 2.1RC? it should be fixed there. If problem persists, please open a new issue.

@kvSanthosh
Copy link

I have the same issue in 2.0.7, this is found when we enable Persistent Shopping Cart, if we have some product in our cart when we re login the mini cart will show 0 items and when we add some product the cart will show the existing products and newly added one together.

@pantaoran
Copy link

I think these issues are the same as the big discussion in #3572

@apurv-anand
Copy link

+1. Facing same issue in M2.1.1

@pboisvert
Copy link

@apurv-anand this ticket is closed. If you are experiencing an issue, can you open a new ticket and provide full system info and steps to reproduce"

@iprabhakar
Copy link

I am using M2.1.2 facing same issue, when I add product after login the not showing in mini cart. Please help me to resolve this issue.

@dambrogia
Copy link

This solved the problem for me, I have read elsewhere that is could possibly cause validation when adding items into your cart (product is out of stock, etc.), but I haven't looked further into that. Anyone who would like to would be welcomed to enlighten me with their information :)

I did this simple fix and haven't had a problem since.

Reference to @fhennessy 's answer:
#5377 (comment)

@priyatoshojha
Copy link

@domdambrogia
I have product in cart after login and when I logout and again login then no product in minicart and when I add any product in cart then my minicart is updated and show the prev added products.
Please let me know if you have resolved this issue.

@iprabhakar
Copy link

I have same issue, after enable Full Page Cache this issue is resolved.

@priyatoshojha
Copy link

@iprabhakar
Thanks, Yes it worked for me after enable full page cache,
So can you please explain why its connected with FPC .
Please let me know if any one knows.

@FloWord
Copy link

FloWord commented Mar 17, 2017

My Solution for refresh Problem:
#5377

You simply need to change
"bindSubmit": false
to
"bindSubmit": true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests