• Resolved paaaasheim

    (@paaaasheim)


    May I ask for your attentention on this issue?

    2024-01-07T21:56:47+00:00 CRITICAL Uncaught Error: Call to a member function get_shipping_country() on null in /home/attendseeme/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart.php:1516 Stack trace: #0 /home/attendseeme/public_html/wp-content/plugins/free-shipping-label/includes/fsl-helper.php(95): WC_Cart->get_shipping_packages() #1 /home/attendseeme/public_html/wp-content/plugins/free-shipping-label/public/fsl-public.php(110): Devnet\FSL\Includes\Helper::get_free_shipping_min_amount() #2 /home/attendseeme/public_html/wp-includes/class-wp-hook.php(324): Devnet\FSL\Frontend\FSL_Public->public_data(”) #3 /home/attendseeme/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #4 /home/attendseeme/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /home/attendseeme/public_html/wp-settings.php(665): do_action(‘wp_loaded’) #6 /home/attendseeme/public_html/wp-config.php(86): require_once(‘/home/attendsee…’) #7 /home/attendseeme/public_html/wp-load.php(50): require_once(‘/home/attendsee…’) #8 /home/attendseeme/public_html/wp-blog-header.php(13): require_once(‘/home/attendsee…’) #9 /home/attendseeme/public_html/index.php(17): require(‘/home/attendsee…’) #10 {main} thrown in /home/attendseeme/public_html/wp-content/plugins/woocommerce/includes/class-wc-cart.php on line 1516

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Marin Matosevic

    (@marinmatosevic)

    Hi,

    Running into this error is a bit unexpected. Our code is designed with checks to prevent function calls when a cart object isn’t present.

    My suspicion is that another plugin or perhaps your theme is causing interference by utilizing a WooCommerce filter hook. This might be altering or initiating data at a later stage in the process. It’s challenging to pinpoint the exact issue without a closer examination.

    If you have a testing site available, could you please try the following code to see if it helps? Simply replace “US” with your desired country code, matching it to your default shipping zone country code.

    add_filter('woocommerce_cart_shipping_packages', function ($packages) {
        // Get the first package from the array
        $package = reset($packages);
    
        // Set the country to 'US' if not already set
        $package['destination']['country'] = $package['destination']['country'] ?? 'US';
    
        // Return the modified packages array
        return $packages;
    });
    Plugin Author Marin Matosevic

    (@marinmatosevic)

    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 feel free to start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fatal error’ is closed to new replies.