hannel_visibility' => $this->coupon_helper->get_channel_visibility( $coupon ), 'sync_status' => $this->meta_handler->get_sync_status( $coupon ), 'issues' => $this->coupon_helper->get_validation_errors( $coupon ), 'is_setup_complete' => $this->merchant_center->is_setup_complete(), 'is_channel_supported' => $this->merchant_center->is_promotion_supported_country( $target_country ), 'get_started_url' => $this->get_start_url(), ]; } /** * Register a service. */ public function register(): void { add_action( 'woocommerce_new_coupon', [ $this, 'handle_submission' ], 10, 2 ); add_action( 'woocommerce_update_coupon', [ $this, 'handle_submission' ], 10, 2 ); } /** * @param int $coupon_id * @param WC_Coupon $coupon */ public function handle_submission( int $coupon_id, WC_Coupon $coupon ) { /** * Array of `true` values for each coupon IDs already handled by this method. Used to prevent double submission. * * @var bool[] $already_updated */ static $already_updated = []; $field_id = $this->get_visibility_field_id(); // phpcs:disable WordPress.Security.NonceVerification // nonce is verified by self::verify_nonce if ( ! $this->verify_nonce() || ! isset( $_POST[ $field_id ] ) || isset( $already_updated[ $coupon_id ] ) ) { return; } // Only update the value for supported coupon types if ( ! CouponSyncer::is_coupon_supported( $coupon ) ) { return; } try { $visibility = empty( $_POST[ $field_id ] ) ? ChannelVisibility::cast( ChannelVisibility::DONT_SYNC_AND_SHOW ) : ChannelVisibility::cast( sanitize_key( $_POST[ $field_id ] ) ); // phpcs:enable WordPress.Security.NonceVerification $this->meta_handler->update_visibility( $coupon, $visibility ); $already_updated[ $coupon_id ] = true; } catch ( InvalidValue $exception ) { // silently log the exception and do not set the coupon's visibility if an invalid visibility value is sent. do_action( 'woocommerce_gla_exception', $exception, __METHOD__ ); } } /** * @return string * * @since 1.1.0 */ protected function get_visibility_field_id(): string { return $this->prefix_field_id( 'visibility' ); } }
Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Admin\MetaBox\CouponChannelVisibilityMetaBox does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 119

Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, bool given in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php:120 Stack trace: #0 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php(120): array_key_exists('Automattic\\WooC...', false) #1 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/CoreServiceProvider.php(385): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\AbstractServiceProvider->conditionally_share_with_tags('Automattic\\WooC...', 'Automattic\\WooC...', 'Automattic\\WooC...', 'Automattic\\WooC...', 'Automattic\\WooC...', 'Automattic\\WooC...') #2 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php(102): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\CoreServiceProvider->register() #3 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(172): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\ServiceProvider\ServiceProviderAggregate->register('Automattic\\WooC...') #4 /htdocs/wp-content/plugins/google-listings-and-ads/src/Container.php(90): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #5 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(130): Automattic\WooCommerce\GoogleListingsAndAds\Container->get('Automattic\\WooC...') #6 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(91): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->maybe_register_services() #7 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\{closure}('') #8 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #9 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #10 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #11 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #12 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #13 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #14 /htdocs/index.php(17): require('/htdocs/wp-blog...') #15 {main} thrown in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 120