0

I'm running into issues when displaying the cart quantity in the header. I'm simply useing Mage::helper('checkout/cart')->getSummaryCount(). It works great sometimes, however it does not display correctly on the front page. I have a feeling that it's related to our full page caching.

I reached out to Magento support and they said that I am doing it different from how they would. But would not provide me with an answer.

Can anyone shed some light on the correct method for displaying cart quantity?

Nick Parsons
  • 8,377
  • 13
  • 48
  • 70
  • What full page caching are you using and have you set the block containing the cart quantity to be excluded from caching? – Jonathan Hussey Mar 12 '13 at 16:09
  • @JonathanHussey I believe it's simply the built in Magento Full Page caching. What's odd is that my code works on every page, except for the home page. I have added the count to links.phtml. And no, I have not excluded it from caching. – Nick Parsons Mar 12 '13 at 16:14
  • Ok so we are talking about EE rather than CE? – Jonathan Hussey Mar 12 '13 at 16:18
  • @JonathanHussey Correct, EE. I looked around and came across `Mage::getSingleton('checkout/session')->getQuote()->getItemsSummaryQty()`. Gave it a shot, and it's doing the same thing. Any thoughts? – Nick Parsons Mar 12 '13 at 16:20
  • Well the core logic uses `Mage::helper('checkout/cart')->getSummaryCount()` as you have above so I don't have any reason to believe that shouldn't return the correct value. How does behaviour change if you disable full page caching? – Jonathan Hussey Mar 12 '13 at 16:39
  • For a dynamic part you need to create a container and exclude it from FPC.It look slike with your home page this has not been done. – Oscprofessionals Mar 12 '13 at 17:20
  • @SatishMantri any recommendations / resources that you can provide? Anything would be helpful. – Nick Parsons Mar 13 '13 at 05:15
  • Did you switch off Full Page Caching plus deleted cache from var folder and checked.Also is there any other caching module in place. – Oscprofessionals Mar 13 '13 at 05:58
  • If disabling FPC results in this problem gone then you need to create containers and exclude this container from getting cached. – Oscprofessionals Mar 13 '13 at 05:59
  • http://stackoverflow.com/questions/9120413/how-do-i-include-a-dynamic-block-in-the-product-page-with-full-page-caching-turn/9125519#9125519 will be of great help in case your issue is related to FPC – Oscprofessionals Mar 13 '13 at 06:02
  • @SatishMantri Full page caching disabled, and the full_page_cache directory has been emptied. Problem still persists. No quantity on home page. – Nick Parsons Mar 13 '13 at 14:10
  • make sure session is not lost when on Home page.Are other session related values if any, available on home page. – Oscprofessionals Mar 13 '13 at 14:20
  • $result=Mage::helper('checkout/cart')->getSummaryCount(); Mage::log($result); Do this and check whats goes into mage Log file.There is a probability that the block code you are looking at and the code responsible and generatin output are different. – Oscprofessionals Mar 13 '13 at 14:27

0 Answers0