0

Have been struggling with this problem for some time now and its a bit confusing. The problem is the following that my cart drops the products added when I visit a new category on the site.

When FPC is disable all works fine.

Have been testing and testing and have found out the the problems occur when the page on the site is not cached. If I have visited the site one time before then its not problem to add the product, but is the category/page in the cache all the items in the cart is droped and when I add the product from the unpages cached this will be the number 1 item in the cart and the other is gone.

Need to find a solution for this problem so I can put the site live and replace my M1 current site. Or maybe M2 is still to full of bugs so its better to wait some time.

There is not problem at all when the FPC is disable then all the items remain in the cart.

Magento 2.3. site: http://kasperstestdev.prod42.magentohotel.dk/

Happy new year btw :)

2
  • Looks like the problem in this case was the minicart that was cacheable. added cacheable="false" to the minicart in default.xml in module-checkout/view/frontend/layout/default.xml Commented Jan 1, 2019 at 14:27
  • This was not the right solution because the hole page does become non cacheble. Any way to only exclude the minicart? Commented Jan 1, 2019 at 15:15

1 Answer 1

0

Generally FPC modules (full page cache) also cache things like cart content. They just cache entire pages most of the time.... FPC's come in many varieties. So care to elaborate what module you are using.

What you are trying to do is HOLE punching. This allows content to be loaded and passed on through the backend. Ex. the cart's content / block should not be cached / hole punched and the data should be collected either through an html request/ajax/esi method..

Based on the FPC module you should search how to disable the block cache on the cart. Usually this is pretty standard, and already included in the documentation of most FPC's.

5
  • It is the build in Full Page Cache and its not an extension so that is the problem. Commented Jan 1, 2019 at 12:19
  • Tried the Luma but with the same result Commented Jan 1, 2019 at 12:19
  • Looks like I have found the problem. Commented Jan 1, 2019 at 14:25
  • Glad you found it! Was the answer in my response? Please let me know if you found it useful ;)
    – John Doe
    Commented Jan 1, 2019 at 22:24
  • The problem is the minicart that gets cached. If I disable the cache then it works fine. You know a way to disable cache for the minicart only? If I do it in default.xml I make all the pages non cachable. Commented Jan 1, 2019 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.