• Плагин вызывает ошибку: get_cart was called incorrectly. Функция получения корзины не должна вызываться раньше чем wp_loaded. This message was added in version 2.3.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Добрый день!

    Уточните, после какого именно действия возникает ошибка?
    Какие версии WordPress и WooCommerce у Вас используются?
    Напишите полный текст ошибки, чтобы было видно, в каком файле и в каком месте кода вызывается ошибка.

    Thread Starter Aleksandr

    (@aleksandrx)

    Возникате после активации вашего плагина. WooCommerce 9.1.4, WordPress 6.6.1.

    Функция get_cart была вызвана неправильно. Функция получения корзины не должна вызываться раньше чем wp_loaded. Backtrace: require(‘wp-blog-header.php’), 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\Integrations\IntegrationRegistry->initialize, do_action(‘woocommerce_blocks_payment_method_type_registration’), WP_Hook->do_action, WP_Hook->apply_filters, {closure}, WC_Payment_Gateways->get_available_payment_gateways, apply_filters(‘woocommerce_available_payment_gateways’), WP_Hook->apply_filters, WC_Deposits_Cart_Manager->disable_gateways, WC_Deposits_Cart_Manager->has_deposit, WC_Cart->get_cart, wc_doing_it_wrong (Это сообщение было добавлено в версии 2.3.)

    1. wc_doing_it_wrong()
      wp-content/plugins/woocommerce/includes/wc-deprecated-functions.php:120
    2. WC_Cart->get_cart()
      wp-content/plugins/woocommerce/includes/class-wc-cart.php:602
    3. WC_Deposits_Cart_Manager->has_deposit()
      wp-content/plugins/woocommerce-deposits/includes/class-wc-deposits-cart-manager.php:211
    4. WC_Deposits_Cart_Manager->disable_gateways()
      wp-content/plugins/woocommerce-deposits/includes/class-wc-deposits-cart-manager.php:1588
    5. apply_filters('woocommerce_available_payment_gateways')
      wp-includes/plugin.php:205
    6. WC_Payment_Gateways->get_available_payment_gateways()
      wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php:333
    7. {closure}()
      wp-content/plugins/yookassa/yookassa.php:99
    8. do_action('woocommerce_blocks_payment_method_type_registration')
      wp-includes/plugin.php:517
    9. Automattic\W\B\I\IntegrationRegistry->initialize()
      wp-content/plugins/woocommerce/src/Blocks/Integrations/IntegrationRegistry.php:50
    10. do_action('init')
      wp-includes/plugin.php:517
    ostulov

    (@ostulov)

    Текст ошибки указывает на плагин woocommerce-deposits.

    Попробуйте на время отключить плагин woocommerce-deposits и проверить, будет ли возникать ошибка при использовании плагина ЮKassa.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘get_cart was called incorrectly’ is closed to new replies.