-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Magento2: model cart do not load quote items on home page #7341
Comments
I 'm having the same issue that getQuote()->getAllVisibleItems() is always empty, if I try to use it in my custom module. Using Magento 2.1.2 EDIT:Okay I got the answer pretty quickly. Read this: Make your block not cacheable inside the layout xml
|
@juhanix that's great, now It works, I close the issue. |
I create my custom theme with some custom module, on home page I tried to get all cart items (from quote) to create my custom mini cart, this is my block:
I add this block on my
default.xml
but when I'm on home page, category pages or on product page the object quote is always empty. While on checkout pages, on customer pages I can see the cart items if they have added.The strangest think is that, if I disable the cache, the quote object works fine everywhere, while with cache enabled I get the quote empty.
Here there is my
<Vendor>\<Theme>\Magento_Theme\layout\default.xml
:Then in
<Vendor>\<Module>\view\frontend\layout\default.xml
:Preconditions
The text was updated successfully, but these errors were encountered: