• Resolved mikikanez

    (@mikikanez)


    Hi. I have a CentOS server with WordPress and WooCommerce installed. I created a plugin to add to cart products after calculating how many products the customer needs. But when I call the “add_to_cart” function with a “no admin” user, the cart keeps empty. It’s weird because on the database I can see the products on the cart in “wp_woocommerce_session” table. I don’t know if there’s a server, WooCommerce or (probably) a cookie issue. Thank you very much.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Ryan Ray

    (@ryanr14)

    Hi @mikikanez,

    Since you mentioned the cookies are working here, this then often times is caused by caching. Do you know if the site or server has any caching in place that could be serving a cached cart page that is empty? 🙂

    If there is any in place, try to exclude the cart and checkout pages and see if that helps things.

    Could you also please share a copy of your site’s System Status? You can find it via WooCommerce > Status.
    Select “Get system report” and then “Copy for support”.  Once you’ve done that, paste it here in your response.

    Thread Starter mikikanez

    (@mikikanez)

    Hi @ryanr14

    Thank you very much for your response.

    There’s no cache plugin installed on WordPress. Probably the problem is on the server, but don’t know where. I don’t installed Varnish.

    Thank you again!

    The system status:

    
    ### WordPress Environment ###
    
    WordPress address (URL): https://xn--salsacalots-t9a.com
    Site address (URL): https://xn--salsacalots-t9a.com
    WC Version: 3.8.0
    REST API Version: ✔ 1.0.2
    Log Directory Writable: ✔
    WP Version: 5.3
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: ✔
    WP Cron: ✔
    Language: ca
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.24
    PHP Version: 7.2.24
    PHP Post Max Size: 128 MB
    PHP Time Limit: 30
    PHP Max Input Vars: 1000
    cURL Version: 7.29.0
    NSS/3.36
    
    SUHOSIN Installed: –
    MySQL Version: 5.6.46
    Max Upload Size: 128 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    
    ### Database ###
    
    WC Database Version: 3.8.0
    WC Database Prefix: wp_
    MaxMind GeoIP Database: ✔
    Mida total de la base de dades: 4.53MB
    Mida de les dades de la base de dades: 3.29MB
    Mida de l'índex de la base de dades: 1.24MB
    wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_comments: Data: 0.08MB + Index: 0.09MB + Engine InnoDB
    wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_options: Data: 2.03MB + Index: 0.03MB + Engine InnoDB
    wp_postmeta: Data: 0.16MB + Index: 0.06MB + Engine InnoDB
    wp_posts: Data: 0.11MB + Index: 0.06MB + Engine InnoDB
    wp_revslider_css: Data: 0.13MB + Index: 0.00MB + Engine InnoDB
    wp_revslider_layer_animations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_revslider_navigations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_revslider_sliders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_revslider_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_revslider_static_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_wc_order_stats: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
    wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    
    ### Security ###
    
    Secure connection (HTTPS): ✔
    Hide errors from visitors: ✔
    
    ### Active Plugins (9) ###
    
    Bridge Core: per Qode Themes – 1.0.5
    Calçutadora: per Miquel – 1.0
    El Jetpack gràcies a WordPress.com: per Automattic – 7.9.1
    Maquetador Visual: per Michael M - WPBakery.com – 6.0.2
    Slider Revolution: per ThemePunch – 5.4.8.3
    WooCommerce Admin: per WooCommerce – 0.22.0
    WooCommerce Services: per Automattic – 1.22.1
    WooCommerce: per Automattic – 3.8.0
    WP Force SSL: per WebFactory Ltd – 1.5
    
    ### Inactive Plugins (1) ###
    
    Akismet Anti-Spam: per Automattic – 4.1.3
    
    ### Settings ###
    
    API Enabled: –
    Force SSL: –
    Currency: EUR (€)
    Currency Position: right
    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)
    
    Connected to WooCommerce.com: –
    
    ### WC Pages ###
    
    Base de la botiga: #6 - /botiga/
    Cistella: #7 - /cistella/
    Finalitzar compra: #8 - /finalitzar-comanda/
    El meu compte: #9 - /el-meu-compte/
    Termes i condicions: ❌ Pàgina sense definir
    
    ### Theme ###
    
    Name: Bridge | Shared By VestaThemes.com
    Version: 18.1
    Author URL: http://qodethemes.com/
    Child Theme: ❌ – Si esteu modificant WooCommerce en un tema pare que no heu creat personalment
    us recomanem utilitzar un tema fill. Visualitza: com crear un tema fill
    
    WooCommerce Support: ✔
    
    ### Templates ###
    
    Archive Template: El teu tema té un fitxer woocommerce.php
    no pots sobreescriure la plantilla personalitzada woocommerce/archive-product.php ja que woocommerce.php té prioritat sobre archive-product.php. Això és intencionat per prevenir problemes de visualització.
    
    Overrides: bridge/woocommerce/cart/cart-empty.php
    bridge/woocommerce/cart/cart-shipping.php
    bridge/woocommerce/cart/cart-totals.php
    La versió 3.5.0 de bridge/woocommerce/cart/cart.php és obsoleta. La versió del nucli és la 3.8.0
    bridge/woocommerce/cart/shipping-calculator.php
    bridge/woocommerce/checkout/form-coupon.php
    La versió 3.2.0 de bridge/woocommerce/checkout/thankyou.php és obsoleta. La versió del nucli és la 3.7.0
    bridge/woocommerce/content-product.php
    bridge/woocommerce/content-single-product.php
    bridge/woocommerce/global/form-login.php
    bridge/woocommerce/global/quantity-input.php
    bridge/woocommerce/loop/add-to-cart.php
    bridge/woocommerce/loop/loop-start.php
    bridge/woocommerce/loop/pagination.php
    bridge/woocommerce/loop/rating.php
    La versió 3.3.0 de bridge/woocommerce/loop/result-count.php és obsoleta. La versió del nucli és la 3.7.0
    bridge/woocommerce/loop/sale-flash.php
    bridge/woocommerce/myaccount/form-login.php
    bridge/woocommerce/myaccount/form-lost-password.php
    bridge/woocommerce/myaccount/my-address.php
    bridge/woocommerce/myaccount/my-orders.php
    bridge/woocommerce/single-product/add-to-cart/external.php
    bridge/woocommerce/single-product/add-to-cart/grouped.php
    bridge/woocommerce/single-product/add-to-cart/simple.php
    bridge/woocommerce/single-product/add-to-cart/variable.php
    bridge/woocommerce/single-product/related.php
    bridge/woocommerce/single-product/sale-flash.php
    bridge/woocommerce/single-product/tabs/additional-information.php
    bridge/woocommerce/single-product/tabs/description.php
    La versió 2.4.0 de bridge/woocommerce/single-product/tabs/tabs.php és obsoleta. La versió del nucli és la 3.8.0
    bridge/woocommerce/single-product/up-sells.php
    
    Outdated Templates: ❌
    					
    					
    						Aprèn com actualitzar
    
    ### Action Scheduler ###
    
    Complete: 125
    Oldest: 2019-11-15 01:03:03 +0000
    Newest: 2019-11-20 07:19:35 +0000
    
    Pending: 1
    Oldest: 2019-11-20 08:19:35 +0000
    Newest: 2019-11-20 08:19:35 +0000
    
    Canceled: 0
    Oldest: –
    Newest: –
    
    In-progress: 0
    Oldest: –
    Newest: –
    
    Failed: 0
    Oldest: –
    Newest: –
    
    
    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @mikikanez!

    Can you also please work through the following troubleshooting documentation to see if anything there helps?

    https://businessbloomer.com/woocommerce-solving-cart-empty-issue/

    Cheers!

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy!

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

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

The topic ‘Cart error for visitors (cookie)’ is closed to new replies.