Cart always says "0 items" when products are added, and sometimes empties completely on ot

#1) My client is getting the first bug in Firefox although I’m not getting in myself… but one other customer reported it too: Sometimes clicking “Add to Cart” on a product page doesn’t seem to do anything. But when they refreshes that same page, the product is in the cart. But they have to refresh for it to show.

#2: In Safari at least, the cart in the header always says “0 item(s)”. Always. Whether it’s expanded or not (View Cart / Hide Cart).

#2b: Still in Safari at least, although the cart says 0 items are in it, only some pages will show the products that have been added to the cart while others show an EMPTY cart. I’ve noticed single products pages show them, for example: ….while product category pages and regular pages show an empty cart. Examples: and

  • Timothy
    • Chief Pigeon

    Sorry when I said gridmarket, I mean the default one with no customisations?

    If it does work then it would be worth testing for plugin conflicts by disabling them all (except MarketPress) and then testing again. If it then works you would re-enable each plugin, one at a time until it happens again.

    Let me know how that goes.

    Take care.

  • Dean Kaus
    • The Bug Hunter

    Hello @great8creative and @timothy as well as @aristath

    I went to all 3 links and selected products to add to the cart. I’m using the latest version of firefox on a PC.

    I’m getting really weird results. After adding 1 item to cart the at the top of page cart still says zero items in cart. I refreshed the page and still zero. I select the cart page to view the cart and get the no items in cart.

    I then tried to add 2 items and after adding the 2nd item the display still said I had zero items in cart however when I went selected to view the cart all 3 items were listed.

    On all 3 links the same thing happened if I added 2 items to cart they would appear only after I selected the view cart button

  • great8creative
    • Design Lord, Child of Thor

    @timothy No worries. Yes, I have made a couple customizations. Thinking this might be the cause of the issues though, I reverted back to the original install, tested, and had the same problems, so I restored my work… which is what you’re seeing now. I tried the plugin trick too but no change there either, unfortunately.

    @aristath I haven’t installed any caching plugins yet. But I DO have the site hosted at WP Engine, and I know they use an aggressive for of caching… Check out the attached screenshot. Do you think this might be causing it??

    @dean Kaus Thanks for the input. That IS strange… I’m on a mac with the latest version of firefox and did the same things you did… I didn’t get the same results when I shopped as a logged-in user but when I logged out and tried again… I DID get the same results. Very odd.

    So I’m noticing different issues between being logged in and shopping as a “guest” on the site… Any ideas??

    Thanks everyone, by the way, for taking the time to look into this for me and offering your input!

  • great8creative
    • Design Lord, Child of Thor

    I just set up a staging area for the site (WP Engine has this awesome feature where it duplicates your site on a temporary URL so you can test changes/updates before publishing them) here: And tested for the same issues before making any changes – before disabling plugins, reverting MarketPress back to the original installed version, etc. – and didn’t get a single bug…… So I’m starting to think it’s on WP Engine’s side, that is has something to do with their way of caching.

    Do any of you get the same issues you were having, when on the staged site?

  • Timothy
    • Chief Pigeon

    Seems to work well on the staging site.

    So it must be the caching they use when on the live site, it prevents the JS updating on the top there.


    This refers to caching the HTML content of a page for a not-logged-in user, rather than having the server regenerate it from scratch using PHP and the database.

    Have you spoken to them yet since your last post to see what they say?

    If so I’d be interested to know.


  • great8creative
    • Design Lord, Child of Thor

    @timothy Yeah, I’ve been going back and forth with them and they agreed it was the caching they use on all their hosted sites. They added a cache exclusion to MarketPress which helped store pages, but didn’t solve every issue. And it only solved it on store pages, not the other regular pages, and not for logged-out users.

    So we’re on the right track but I just got another response from them this morning that I’m not 100% happy about:

    Hi Sarah, so the issue here is that we use varnish to cache your site. Varnish makes your site lightening fast but unfortunately cannot distinguish parts of the page that should not be cached. So the solution here is to make that cart widget load asynchronously using ajax … in other words insert the widget into the page after the html page has loaded. Do you have a developer that can help you do this? I can send an email to the theme developer and recommend they change that moving forward.


    August 28, 2012 10:18 am

    What do you think?

    Personally, I don’t think this is the right solution for the long term. For one I shouldn’t have to pick up consequences of their caching issues and 2, I don’t want to pay for another developer’s time (or spend any more of my own or my client’s time) to fix this…. because wouldn’t I have to do the same for every site I build in the future, using WPMU plugins and their hosting?

    Sorry…. if I’m completely off on this, just tell me. :slight_smile:

  • aristath
    • Recruit

    Might I suggest the obvious simple solution?

    Why don’t you simply disable this feature? I mean ok, it’s cool to have a sliding cart but if the combination of caches+sliding cart is buggy, just remove the sliding effect!

    Remove a few lines from your header.php file to make the “Cart” a simple link to your cart and hide the quantity. This way you won’t have to worry about caches…

    Varnish is one of the most powerful reverse proxies and speed is better than an effect on the header.

  • Timothy
    • Chief Pigeon

    Personally, I don’t think this is the right solution for the long term. For one I shouldn’t have to pick up consequences of their caching issues and 2, I don’t want to pay for another developer’s time (or spend any more of my own or my client’s time) to fix this…. because wouldn’t I have to do the same for every site I build in the future, using WPMU plugins and their hosting?

    Ya, it would also mean that every update of our code will need you to edit and make changes again.

    We do have a relationship with WP Engine, and they do seem like a really decent company. But with speed in this case comes compromise.

    If Mike can send you those recommendations he spoke of then I can present them to our developer for future inclusion. This isn’t a guarantee, but WP Engine are a fair size company so it would be considered but the final decision lays with the developer.

    Also after their last changes can you outline what issues still remain.


  • great8creative
    • Design Lord, Child of Thor

    @aristath that’s definitely a consideration but again, I don’t think that’s the long term solution. I don’t want to just remove a feature all together every time it has an issue. I guess if that’s what it comes down to this time, I’ll definitely take out the sliding effect and cart quantities. IF I really have to. :slight_smile: Thanks for your input.

    @timothy I’m on the same page completely, thanks. I’ll get back to you in a bit.

  • Aaron
    • CTO

    If they can put in a cache exclusion rule for the cart cookie then noone would ever have a problem. The cookie name is per WP install, but I would think that they should be able to just use the prefix:

    'mp_globalcart_' . COOKIEHASH

    Note that their form of caching will cause these kind of problems with any plugin that relies on dynamic front end content for logged out users. They probably deal with them on a case by case basis.

  • great8creative
    • Design Lord, Child of Thor

    Awesome. I copied your response on my thread at WP Engine and Mike Van Winkle replied with this:

    Hi Sarah, Let me check with my system administrator … this might be doable. I’d love to speak directly with them though. Do you have his/her email?

    Let me know. Thanks! my email is ***********

  • great8creative
    • Design Lord, Child of Thor

    Thank you. :slight_smile:

    And yes! Mike just replied a few minutes ago with this:

    Ok Sarah, this worked and you should be good to go for now … I say for now because I’m in the process of getting the config changes added permanently to all sites. If there’s an objection to this we’ll need to revisit and look for a solution that will not be overwritten next time you particular cluster is updated. I should have more info shortly.



    Everything looks great. And I can’t thank you both enough for sticking this one out for me! Thank you!!

  • great8creative
    • Design Lord, Child of Thor

    :slight_smile: Well to add to it, check out their latest reply on my thread over there:

    Hey Sarah,

    I’ve added an exception for this plugin to our system that will roll out across all of WP Engine next week so that other customers who may use this plugin won’t have this issue. I’ve, for now, rolled it to your site and tested and confirmed the shopping cart functionality still works as expected. Thanks for working with us on this and helping contribute to something that will benefit WP Engine customers as a whole!


    Systems Lead

    WP Engine

    Pretty cool stuff. I’m happier than ever that I use WPMU for all my themes and plugins and WP Engine for hosting. Recommend you guys to everyone. Thanks again. :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.