Support » Plugin: WooCommerce » Woocommerce ajax add to cart, basket,checkout not keeping any sessions

  • Resolved jameshb

    (@jameshb)


    Dear Woocommerce community,

    We’ve recently put our wordpress test site https://www.i-alevel.co.uk/ on cloudlfare’s free plan but we are having issues with the woocommerce (standard storefront theme) ajax add to cart and pages with dynamic content like basket, account, checkout not working and just returning blanks.

    The ajax cart and pages listed above all work fine when logged in as admin.

    Please feel free to navigate to the domain to replicate.

    I’ve tried disabling rocketloader as I saw in one of cloudflare’s articles but this doesn’t help I’m afraid.

    I’ve gone through most settings and tweaked but had no joy either.

    I’ve also configured 2 page rules as per cloudflare’s guide: 1) to bypass ajax (e.g. http://www.i-alevel.co.uk/ajax* > settings ‘cache level: Bypass’) and 2) cache everything else but they don’t work either. I have managed to get other page rules working (tested a simple redirect page rule which worked fine after purging the cache and waiting a minute) just not these.

    I’ve tried pausing cloudflare, uninstalling the cloudflare plugin for wordpress, deactivating w3 total cache and reactivating to check for conflicts and nothing has been able to stop the basket page being empty and the ajax cart not adding more than 1 product to it (it then just goes back to empty as soon as you navigate to another page).

    As you’ll see from the site, we’re looking to scale a 100k product site upwards and understand that there may be costs involved to get the speed and caching functionality we need, but we’d want to atleast see if we can run an ecommerce store with those dynamic cart elements on cloudflare free plan first.

    Can you advise where we might be going wrong? (Or if this is only solvable by upgrading plans)

    Many, many thanks in advance (I don’t know what to try next!) I’ve posted over on cloudflare forum who suggested coming here. They have an incling its a sessions issue which would make sense.

    
    ### WordPress Environment ###
    
    Home URL: https://www.i-alevel.co.uk
    Site URL: https://www.i-alevel.co.uk
    WC Version: 3.4.5
    Log Directory Writable: ✔
    WP Version: 4.9.8
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ✔
    Language: en_GB
    External object cache: ✔
    
    ### Server Environment ###
    
    Server Info: nginx/1.10.3
    PHP Version: 7.0.30-0ubuntu0.16.04.1 - We recommend using PHP version 7.2 or above for greater performance and security. How to update your PHP version
    PHP Post Max Size: 8 MB
    PHP Time Limit: 0
    PHP Max Input Vars: 1000
    cURL Version: 7.47.0
    OpenSSL/1.0.2g
    
    SUHOSIN Installed: –
    MySQL Version: 5.7.22-22
    Max Upload Size: 8 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ❌ Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    
    ### Database ###
    
    WC Database Version: 3.4.5
    WC Database Prefix: wp_
    MaxMind GeoIP Database: ✔
    Total Database Size: 865.69MB
    Database Data Size: 491.46MB
    Database Index Size: 374.23MB
    wp_woocommerce_sessions: Data: 1.48MB + Index: 0.02MB
    wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB
    wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB
    wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB
    wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB
    wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB
    wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB
    wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB
    wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB
    wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB
    wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB
    wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB
    wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB
    wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB
    wp_comments: Data: 0.02MB + Index: 0.08MB
    wp_links: Data: 0.02MB + Index: 0.02MB
    wp_options: Data: 2.05MB + Index: 0.05MB
    wp_pmxe_exports: Data: 0.02MB + Index: 0.00MB
    wp_pmxe_google_cats: Data: 0.39MB + Index: 0.00MB
    wp_pmxe_posts: Data: 0.02MB + Index: 0.00MB
    wp_pmxe_templates: Data: 0.02MB + Index: 0.00MB
    wp_pmxi_files: Data: 0.02MB + Index: 0.00MB
    wp_pmxi_history: Data: 0.02MB + Index: 0.00MB
    wp_pmxi_images: Data: 1.52MB + Index: 0.00MB
    wp_pmxi_imports: Data: 0.19MB + Index: 0.00MB
    wp_pmxi_posts: Data: 7.52MB + Index: 5.03MB
    wp_pmxi_templates: Data: 0.08MB + Index: 0.00MB
    wp_postmeta: Data: 357.94MB + Index: 316.75MB
    wp_posts: Data: 85.63MB + Index: 26.84MB
    wp_termmeta: Data: 1.52MB + Index: 0.59MB
    wp_terms: Data: 1.52MB + Index: 3.03MB
    wp_term_relationships: Data: 29.58MB + Index: 20.55MB
    wp_term_taxonomy: Data: 1.52MB + Index: 0.77MB
    wp_usermeta: Data: 0.02MB + Index: 0.03MB
    wp_users: Data: 0.02MB + Index: 0.05MB
    wp_wc_download_log: Data: 0.02MB + Index: 0.03MB
    wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB
    wp_wpmm_subscribers: Data: 0.02MB + Index: 0.00MB
    
    ### Post Type Counts ###
    
    attachment: 102692
    customize_changeset: 2
    page: 6
    post: 2
    product: 102721
    
    ### Security ###
    
    Secure connection (HTTPS): ✔
    Hide errors from visitors: ✔
    
    ### Active Plugins (10) ###
    
    Query Monitor: by John Blackbourn & contributors – 3.1.0
    Child Theme Configurator: by Lilaea Media – 2.3.0.4
    Cloudflare: by John Wineman
    Furkan Yilmaz
    Junade Ali (Cloudflare Team) – 3.3.2
    
    Image Sizes: by Nazmul Ahsan – 2.0.0
    W3 Total Cache: by Frederick Townes – 0.9.7
    WooCommerce: by Automattic – 3.4.5
    WP All Export Pro: by Soflyy – 1.5.3
    WP All Import Pro: by Soflyy – 4.5.4
    WP Maintenance Mode: by Designmodo – 2.2.1
    WP All Import - WooCommerce Add-On Pro: by Soflyy – 2.4.1
    
    ### Settings ###
    
    API Enabled: –
    Force SSL: –
    Currency: GBP (£)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    ### WC Pages ###
    
    Shop base: #5 - /shop/
    Basket: #6 - /basket/
    Checkout: #7 - /checkout/
    My account: #8 - /my-account/
    Terms and conditions: ❌ Page not set
    
    ### Theme ###
    
    Name: Storefront Child
    Version: 2.3.3.1536051609
    Author URL: https://woocommerce.com/
    Child Theme: ✔
    Parent Theme Name: Storefront
    Parent Theme Version: 2.3.3
    Parent Theme Author URL: https://woocommerce.com/
    WooCommerce Support: ✔
    
    ### Templates ###
    
    Overrides: –
    

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Anyone had any experience with this or a fix?

    Anyone?

    Sorry don’t mean to sound obtuse but the issue is what that the products aren’t being added to the cart page?

    Plugin Support John Coy

    (@johndcoy)

    Automattic Happiness Engineer

    Hi @jameshb

    I see you have a custom Storefront theme with a version number I am not familiar with.

    >ajax add to cart and pages with dynamic content like basket, account, checkout not working and just returning blanks.

    Could you try switching back to a default theme like Twenty Seventeen and disable all plugins except for WooCommerce to see if this resolves the issue?

    If so, then re-enable each one at a time until you find the one that’s causing the conflict.

    jameshb

    (@jameshb)

    Hi guys,

    After much debugging, the culprit was varnish! I stopped it running in the command line with: service varnish stop then disabled it with: systemctl disable varnish

    I will be looking into Nginx fastcgi cache instead as a better option going forward.

    Thank you Stefster & John

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Woocommerce ajax add to cart, basket,checkout not keeping any sessions’ is closed to new replies.