get_cart was called incorrectly
-
Dear plugin Developers,
Thank you so much for the hard work you are putting into the plugin, it’s much appreicated.
However one of our sites’ logs is being overflooded with a WooCommerce error
get_cart was called incorrectly. Get cart should not be called before the wp_loaded action. Backtrace: require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, Automattic\WooCommerce\Blocks\BlockTypesController->register_blocks, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->__construct, Automattic\WooCommerce\Blocks\BlockTypes\Checkout->initialize, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->initialize, Automattic\WooCommerce\Blocks\BlockTypes\Checkout->register_block_type_assets, Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->register_block_type_assets, Automattic\WooCommerce\Blocks\Assets\Api->register_script, apply_filters('woocommerce_blocks_register_script_dependencies'), WP_Hook->apply_filters, Automattic\WooCommerce\Blocks\Payments\Api->add_payment_method_script_dependencies, Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry->get_all_active_payment_method_script_dependencies, Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType->get_payment_method_script_handles_for_admin, Mollie\WooCommerce\Assets\MollieCheckoutBlocksSupport->get_payment_method_script_handles, Mollie\WooCommerce\Assets\MollieCheckoutBlocksSupport::localizeWCBlocksData, Mollie\WooCommerce\Assets\MollieCheckoutBlocksSupport::gatewayDataForWCBlocks, WC_Payment_Gateways->get_available_payment_gateways, apply_filters('woocommerce_available_payment_gateways'), WP_Hook->apply_filters, Alg_WC_PGPP_Core->filter_available_payment_gateways_per_category, WC_Cart->is_empty, WC_Cart->get_cart, wc_doing_it_wrong. This message was added in version 2.3.
I’m talking 2.5+ GB error log per month!
Could you please not call get_cart incorrectly? ??
PS. I have already tried to change Add filter to “In constructor” instead of “init” and still the same!
Kind Regards.
- The topic ‘get_cart was called incorrectly’ is closed to new replies.