0

Magento 1.9 shows 'shopping cart is empty' when i add product to cart while default cache enabled. when i turn off the cache, cart is working fine.

my session and cookie settings seems to be fine

Cookie Lifetime: 86400
Cookie Path: /
Cookie Domain: .website.com
Use HTTP Only: No
Cookie Restriction Mode: No

Use SID on Frontend: Yes

maybe this issue from 'xcache' it's enabled in my server..?

xcache.admin.enable_auth="on"
xcache.admin.pass="*****"
xcache.admin.user="mOo"
xcache.cacher="On"
xcache.coredump_directory=""
xcache.count="1"
xcache.coveragedump_directory="/tmp/pcov/"
xcache.coverager="Off"
xcache.gc_interval="0"
xcache.mmap_path="/dev/zero"
xcache.optimizer="Off"
xcache.readonly_protection="Off"
xcache.size="0"
xcache.slots="8K"
xcache.test="Off"
xcache.ttl="0"
xcache.var_count="1"
xcache.var_gc_interval="300"
xcache.var_maxttl="0"
xcache.var_size="0"
xcache.var_slots="8K"
xcache.var_ttl="0"
2
  • If you have a custom cart, you may need to hole punch the cache. There is a lot of reference material on hole punching Magento's FPC. – MagentJo Feb 24 '17 at 14:56
  • not i'm not using custom cart – Mo Darwish Feb 25 '17 at 14:30
0

Usually having an empty cart is a cookie issue. It sounds like you've added in a cookie domain; I would try different combinations, including using the www. version of the site.

The second thing to look at is where your session files are being stored on the site. Session files not saving properly are usually the #2 reason why a cart shows as empty. They could be in the file system (i.e. /var/ directory), they could be in the database (much slower, but sometimes done if you have a lot of front end web servers), or in a separate cache like memcache. I would check to see where the session files are being stored.

Third, a caching system could affect your site having contents in the cart. This will depend on what type of cache you are using. If you're using a caching system like Varnish, you need to specifically exclude the cart and checkout pages. Varnish is very difficult to get working with Magento 1.9 due to all of the places where it will automatically cache pages like the checkout pages.

If you're using Amasty Full Page Cache or Extendware, then you'll want to make sure to exclude the checkout and cart pages in their configurations.

I hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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