Cart/AJAX fatal error (WCML + XStore conflict)

This topic has 5 replies, 3 voices, and was last updated 2 months ago ago by Jack Richardson

  • Avatar: Kristjan_Rebane
    Kristjan
    Participant
    September 30, 2025 at 09:08

    PHP Fatal error: Uncaught Error: Call to a member function get_id() on null in /data01/virt79748/domeenid/www.hilo.ee/suuterviseu/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-cart.php:697
    Stack trace:
    #0 /data01/virt79748/domeenid/www.hilo.ee/suuterviseu/wp-includes/class-wp-hook.php(326): WCML_Cart->adjust_cart_item_product_name(NULL)
    #1 /data01/virt79748/domeenid/www.hilo.ee/suuterviseu/wp-includes/plugin.php(205): WP_Hook->apply_filters(NULL, Array)
    #2 /data01/virt79748/domeenid/www.hilo.ee/suuterviseu/wp-content/themes/xstore/framework/woo.php(1763): apply_filters(‘woocommerce_car…’, NULL, NULL, ‘ae6731c0e066a5f…’)
    #3 /data01/virt79748/domeenid/www.hilo.ee/suuterviseu/wp-includes/class-wp-hook.php(324): etheme_get_added_cart_product_info(”)
    #4 /data01/virt79748/domeenid/www.hilo.ee/suuterviseu/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(”, Array)
    #5 /data01/virt79748/domeenid/www.hilo.ee/suuterviseu/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #6 /data01/virt79748/domeenid/www.hilo.ee/suuterviseu/wp-admin/admin-ajax.php(207): do_action(‘wp_ajax_nopriv_…’)
    #7 {main}
    thrown in /data01/virt79748/domeenid/www.hilo.ee/suuterviseu/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-cart.php on line 697

    4 Answers
    Avatar: Alex Carter
    Alex Carter
    Support staff
    September 30, 2025 at 10:34

    Hello,

    Thank you for reaching out to us and for providing the detailed error message. The issue you are experiencing is related to the WooCommerce Multilingual plugin, specifically in the class-wcml-cart.php file, where the function is attempting to call get_id() on a null value. This usually happens when the product data is not being passed correctly to the cart adjustment function.

    We kindly recommend the following steps:
    1. Make sure that both WooCommerce and the WooCommerce Multilingual plugin are updated to their latest versions.
    2. Temporarily disable third-party plugins (except WooCommerce and WPML/WooCommerce Multilingual) to check if there is a conflict.
    3. Switch to a default WordPress theme (such as Storefront) to confirm whether the issue is related to the theme or the plugin.
    4. If the error does not occur with the default theme, please provide us with temporary wp-admin and FTP access in a secure way, so we can investigate the issue directly on your site.

    Please let us know the results of these steps, and we will be glad to assist you further.

    Best Regards,
    8Theme’s Team

    Avatar: Kristjan_Rebane
    Kristjan
    Participant
    October 1, 2025 at 08:56

    I have all the latest versions. The issue happens when you add product to cart and are using translated page. If you are using default language it does not happen.

    Switch to a secondary language.
    Add a product (AJAX: ?wc-ajax=add_to_cart / popup).
    → 500 error.

    XStore’s etheme_get_added_cart_product_info() triggers woocommerce_cart_item_name with NULL args; WCML’s WCML_Cart->adjust_cart_item_product_name() then calls $product->get_id() on null → fatal.

    Avatar: Kristjan_Rebane
    Kristjan
    Participant
    October 1, 2025 at 08:57

    You have to add it from product page to cart.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    October 1, 2025 at 12:14

    Hello @Kristjan
    Could you please provide temporary wp-admin access? We need to check your settings.

    To grant WP-Admin access, please proceed to create a new user account with an administrator role through your WordPress Dashboard. Once the account is established, you may securely transmit the username and password to us via the Private Content section designated for this purpose.

    Also, please, attach us the video so we could recreate the issue on your web-site.

    Kind regards, Jack Richardson
    The 8theme’s team

  • Viewing 5 results - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.