• Resolved SandyRig

    (@sandyrig)


    I have a feature on site that checks cart items and recommend related products but the feature stops working when?Evercache for Woo Commerce?is turned on in?WPEngine. I have investigated and it turns out that this function get_cart() returns empty array for some reason after turning on Evercache.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Stef

    (@serafinnyc)

    @sandyrig I would reach out to WPE and ask if there’s a setting in their EverCache to prevent it being applied to get_cart. There pretty good about helping out. As for adding any type of override they’re not.

    Just to let you know also this forum is for WooCommerce core issues. We do not support any 3rd party plugins or customization. If they can’t help you, you may want to find a developer, assuming you’re not a developer.

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @sandyrig

    This could be due to how Evercache handles sessions and cookies, which are crucial for the get_cart() function to work properly. Evercache is designed to speed up your website by caching content, but this might interfere with dynamic features like your cart.

    As a first troubleshooting step, you might need to exclude the cart and checkout pages from being cached by Evercache. This can usually be done from the settings of your caching plugin or from the WPEngine dashboard.

    If this doesn’t resolve your issue, you may need to contact WPEngine support for further assistance. They would be better equipped to handle issues specifically related to their platform and plugins.

    I hope this helps! If you have any other questions, feel free to ask.

    Thread Starter SandyRig

    (@sandyrig)

    I contacted WPEngine. They were clueless. We spent 2 hours and 2 different agents but they didn’t know what was going on. We tried excluding the cart and it didn’t help as well.

    They said this function is being cached. I asked if it’s being cached why is it not showing cached data and they had no idea. They suggested turning off the cache. How is that a solution.

    It’s not making any sense why a core function of woocommerce stops working/returning data when the cache is turned on.

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @sandyrig

    Caching can indeed cause issues with dynamic functions like get_cart(), as caching essentially saves a static version of the site to improve load times, which can interfere with real-time updates.

    However, it’s unusual that excluding the cart from the cache didn’t resolve the issue. It’s possible that other dynamic parts of your site are being affected by the cache as well.

    As a next step, I would recommend trying to exclude all pages that use the get_cart() function from being cached. If that doesn’t work, you might need to consider using a different caching solution that offers more granular control over what gets cached.

    I understand that turning off the cache doesn’t seem like a viable solution, but it might be worth temporarily trying it to see if it resolves the issue. This could help confirm if the problem is indeed related to the cache.

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.