WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
W3 and WooCommerce / Shopping Carts (57 posts)

  1. larabbit7
    Member
    Posted 1 year ago #

    Hello,

    Will W3 work with WooCommerce and shopping carts? How will the carts remain dynamic on pages where the shopping cart exists?

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. James
    Member
    Posted 1 year ago #

    W3TC works just fine with WooCommerce, my own site runs both. As I understand it, WooCommerce automatically adds the required settings to all of the shop pages so that these pages are not cached.

    Regards, James

  3. gabrielstuff
    Member
    Posted 1 year ago #

    Hi James, could you tell us what version of woocommerce and W3total cache you are using.

    I've done several test and basic installation of W3total cache + woocommerce guarenteed compatible themes (wordpress default + wootique) showed me that the both doesn't like each other.

    Turning off browser caching did help to make all the woocommerce function work.
    Unfortunately this can not be a solution.

  4. James
    Member
    Posted 1 year ago #

    Gabrielstuff - I'm using the latest versions of all, ie WP 3.5.1 with WooCommerce 2.0.4 and W3TC 0.9.2.8. My theme is 'Striking' which seems fairly compatible with the above despite not being a WooTheme.

    Might be a server configuration error perhaps? It's taken a while for me to get mine right - a private VPS server with APC caching installed. Made a big difference to page load speeds and PageRank and YSlow scores.

    I do have css minification turned off at the moment though as it seems to cause issues with some plugins (specifically the Grid / list view toggle plugin) but other than that, all good.

    I had W3TC and WC installed on my old HostPapa shared hosting (albeit with basic disc caching) and that also worked fine. So W3TC and WC are definitely compatible in my experience.

    James

  5. gabrielstuff
    Member
    Posted 1 year ago #

    I didn't say they are not compatible. They are just not really friends.
    I put a demo site for all of us in order to demonstrate it.

    ++

  6. hlwinkler
    Member
    Posted 1 year ago #

    I had a nonfunctional WC cart with W3TC 0.9.2.8 until I turned off database cache (disk). So far it seems to work fine with page caching, object caching, browser caching and CDN.

  7. gabrielstuff
    Member
    Posted 1 year ago #

    Hello,

    Here :
    http://woo.draft.lu/shop/

    You'll find a basci wordpress install with last W3TC + last Woocommerce + last WordPress

    It does not work with basic install.

    Please let me know if you want access, I can send you some via PM.

  8. James
    Member
    Posted 1 year ago #

    Gabrielstuff - can you be at little bit more specific please regarding what exactly doesn't work? There are no details in any of your posts above, just general comments like 'does not work', 'not good friends' and they 'don't like each other'. I'm afraid that doesn't really help anyone! If you can give specific examples of problems then others can check whether they work for them and report back.

    I have found one problem this week in my own install when I tried using variations for products. The price, stock and 'add to cart' button were not being shown (set as display: hidden) in css. They should become unhidden when a customer selects a variation, but this wasn't happening. I found this was due to css minification being turned on, so I've had to turn it off for now until I can investigate further. Not sure whether this is an issue with my theme (Striking) or WC + W3TC compatibility.

    Regards, James

  9. gabrielstuff
    Member
    Posted 1 year ago #

    Well, the problem is the same for everyone :

    1. Check this page :

    http://woo.draft.lu/shop/

    Add some products.

    2. See the cart updated, now go to the cart :

    http://woo.draft.lu/cart/

    See no product, the cart is empty.

    3. try to remove some product :

    See, product are not removed.

    I should have define the issue more specifically but well, the thing is the cart doesnt work. Admin wroks, products display, etc etc but the SHOPING experience is trashed.

    This various issue are mentioned here :
    http://wordpress.org/support/topic/w3tc-woocomerce-shopping-cart?replies=2
    https://github.com/woothemes/woocommerce/issues/2598

    And a basic search on google shows lot of people having issue setupping WooC + W3TC

  10. emielm
    Member
    Posted 1 year ago #

    Hey Gabriel,

    I experienced the exact same problem. Didn't get support from Woocommerce or W3 either, so went to figure it out myself.
    The database caching appears to be the problem. I turned that off and everything works smooth now. I even think it's working faster than with database caching enabled, but not sure about that.

    May be Frederick also has something to add to this?

    Anyway, hope this solves it for you too Gabriel!

  11. gabrielstuff
    Member
    Posted 1 year ago #

    hey !
    If you read my statement in the github issues, you'll see that you do not have to turn of database caching :)

    Adding :
    Adding to W3TC database cache the query stems :

    _wc_session_

    fix the issue when database cache is on.
    Maybe I miss something else but I'm fully sure that I want database caching for the rest of my site.

    ^^

  12. emielm
    Member
    Posted 1 year ago #

    Thanks for this reply. Didn't mention the discussion on github. Tried to exclude these query items and you're absolutely right. Works great! Database caching is enabled for the rest of my site now again. Thanks!

  13. gabrielstuff
    Member
    Posted 1 year ago #

    Damn :( and you do not have any issues ? did you tried the test site I run ? http://woo.draft.lu/shop/

    did you have the browser cache enabled ?

  14. emielm
    Member
    Posted 1 year ago #

    No other issues here.

    I got all other types of caching enabled:
    Minify, db, odject cache via APC, page disk enhanced and Browser cache also enabled.

    Excluded wc_session instead of _wc_session_ for database caching, could that make the difference?

    BTW: How did you find out you had to exclude this query item? I am having a similar problem in woocommerce sensei, so would love to know how to find the query item to exclude there.

  15. gabrielstuff
    Member
    Posted 1 year ago #

    Well, just log out the database query cache state via W3TC (general setting logs -> check database).
    Then look at what is trying to cache or has aready cached. Then put away this stems !

    Ok, could you drop out your browser cache settings here ? what is check or not ?

    For the demo site :

    Specify global browser cache policy.

    [x] Set Last-Modified header

    [x] Set expires header

    [x] Set cache control header

    [x] Set entity tag (eTag)

    [ ] Set W3 Total Cache header

    [x] Enable HTTP (gzip) compression

    [ ] Prevent caching of objects after settings change

    [ ] Disable cookies for static files

    [ ] Do not process 404 errors for static objects with WordPress

  16. gabrielstuff
    Member
    Posted 1 year ago #

    Check the test site, you will see that the cart gets updated only if your refresh the page. That is exactly where I'm sure browser cache makes woo fail.

  17. emielm
    Member
    Posted 1 year ago #

    Thanks again for your reply. Figured out my problem yet, was a page caching issue. Hope I can help you with this:

    My settings are the same as your settings, except from

    [X] Disable cookies for static files (I got this turned on)

    Got to go in a minute, but will reply later if you need something that could help you out.

  18. gabrielstuff
    Member
    Posted 1 year ago #

    nop, this does not solve it. : (

  19. gabrielstuff
    Member
    Posted 1 year ago #

    When

    Set expires header
    is checked adding to car works but deleting does not.

    if set cache control is set it works :)

    Set cache control header

    So basically i've got :

    [ x ] Set Last-Modified header
    
    [    ] Set expires header
    
    [ x ] Set cache control header
    
    [ x ] Set entity tag (eTag)
    
    [    ] Set W3 Total Cache header
    
    [ x ] Enable HTTP (gzip) compression
    
    [    ] Prevent caching of objects after settings change
    
    [ x ] Disable cookies for static files
    
    [    ] Do not process 404 errors for static objects with WordPress

    and it seems to work.

    unfortunatly I need the "Set expires header" parameter

  20. James
    Member
    Posted 1 year ago #

    Damn gabrielstuff - you're right! Just been playing around with my store and found that the add to cart functionality is not working for non-logged in users. I've (stupidly) only been testing whilst being logged in, can you bear with me while I just go into the corner and give myself a good kicking..... :'(

    No wonder things seemed a little quiet by way or orders of late. Mainly only repeat business, which now makes sense since only logged in users (existing customers) can add any products to their cart! Damn, damn, damn.

    Anyway, I've added:

    wc_sessions_

    to my Database Cache > Advanced > Ignored query stems option box which seems to have resolved the add to cart issue. Thanks for finding that fix.

    My remove from cart seems broken (again as you described) if you click the X next to the product in the cart, but works if you reduce the quantity to 0 then update the cart.

    I'll do some further testing and report back. I thought it was very strange it seemed to be working for me and not others, since this was almost certainly not through any clever setup on my part!

    James :'(

  21. James
    Member
    Posted 1 year ago #

    Turning off 'Browser Cache > General > Set expires header' seems to have solved the delete from cart 'x' button not working issue for me.

    Adding:

    /cart/*
    /checkout/*

    as mentioned in the other thread didn't seem to make any difference. Is the format correct in these terms? From a quick read of the W3TC FAQs here it looks like it should maybe be:

    /cart/.+
    /checkout/.+

    or

    /cart*
    /checkout*

    but I can't quite make out which. Anyway, I've tried all three variations and it didn't seem to help.

    So for me, turning off the expires header and adding the wc_session as described above seems to have restored cart functionality for non-logged in user, although I'm still testing this.

  22. kwd
    Member
    Posted 1 year ago #

    Well -- finally -- adding _wc_session_ to my to my Database Cache > Advanced > Ignored query stems option box fixed the issue with non-logged in users being able to add product to cart. I want to thank all of the above posters for helping me resolve this issue.
    I spent many many hours trying to figure out what in the world was making the cart do this. Now both W3TC and woo shopping cart work great together. YAY!! :)

  23. emielm
    Member
    Posted 1 year ago #

    Hey kwd, James and others,

    I got everything on woocommerce 2.0 working perfect for logged in and logged out users. The only things I did:

    Exclude cart and checkout page from page cache:
    cart
    checkout

    (no regular expressions and/or slashes needed, just the page names)

    Ignore query stems:
    wc_session

    Hope this works for you too!

  24. onlyshawn
    Member
    Posted 1 year ago #

    emielm; I've been mucking about with w3tc/cdn/my server setttings/etc. trying to get them to play nicely together with woo (but really not sure WHERE my slow-site issues have been coming from.

    would you mind sharing your configuration settings, or where you went to find a tutorial that worked for woo and w3tc?

    you can post here, or email me at (this username) at gmail...I'd love to get this all humming along nicely, but as of now I only have browser cache and CDN working; I feel like I'm missing out on a lot of speed capabilities with w3tc.

    thanks...

  25. kwd
    Member
    Posted 1 year ago #

    @ onlyshawn
    The only thing I did was follow instructions from James post above and it worked like a charm.

    wc_sessions_

    to my Database Cache > Advanced > Ignored query stems option box which seems to have resolved the add to cart issue.

    Take wc_sessions_
    and add it to your query stems. Follow the >'s above to find out where to do this. Hope it works for you. Do this inside your WordPress W3TC settings, not the server.

  26. gabrielstuff
    Member
    Posted 1 year ago #

    All the above solution work fine. Except the :

    [ ] Set expires header

    if set to true, deleting stuff in the cart, won't work.

  27. Watch Teller
    Member
    Posted 1 year ago #

    Hi Gabriel stuff,

    You mean to unchecked the "set expires head" to solve it right?

    THANKS

  28. gabrielstuff
    Member
    Posted 1 year ago #

    yes, you have to remove set expires header if you want the deleting feature to work.

  29. Watch Teller
    Member
    Posted 1 year ago #

    Hi Gabrielstuff,

    Thanks you update here.

  30. timit
    Member
    Posted 1 year ago #

    hi,

    it is strange...

    I have checked
    Set expires header
    and can remove items in the basket.

    But if I put
    wc_sessions_
    in Database Cache > Advanced > Ignored query stems
    it still does not work adding a new item to the basket.

    It is the other way round as mentioned above....

    any ideas?

    Cheers

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic