function map_rates_to_locations( array $shipping_rates, array $locations ): void { if ( empty( $shipping_rates ) || empty( $locations ) ) { return; } foreach ( $locations as $location ) { $location_rates = []; foreach ( $shipping_rates as $shipping_rate ) { $location_rates[] = new LocationRate( $location, $shipping_rate ); } $country_code = $location->get_country(); // Initialize the array if it doesn't exist. $this->location_rates[ $country_code ] = $this->location_rates[ $country_code ] ?? []; $location_key = (string) $location; // Group the rates by their parent country and a location key. The location key is used to prevent duplicate rates for the same location. $this->location_rates[ $country_code ][ $location_key ] = $location_rates; } } }
Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Shipping\ShippingZone does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73

Warning: foreach() argument must be of type array|object, bool given in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73

Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Jobs\UpdateAllProducts does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Exception/ValidateInterface.php on line 22

Fatal error: Uncaught Error: Interface "Automattic\WooCommerce\GoogleListingsAndAds\Jobs\BatchedActionSchedulerJobInterface" not found in /htdocs/wp-content/plugins/google-listings-and-ads/src/Jobs/AbstractBatchedActionSchedulerJob.php:22 Stack trace: #0 /htdocs/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php(90): require() #1 /htdocs/wp-content/plugins/google-listings-and-ads/src/Jobs/AbstractProductSyncerBatchedJob.php(20): Automattic\Jetpack\Autoloader\jpf11009ded9fc4592b6a05b61ce272b3c_jetpackⓥ13_5\al3_0_8\PHP_Autoloader::load_class('Automattic\\WooC...') #2 /htdocs/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php(90): require('/htdocs/wp-cont...') #3 /htdocs/wp-content/plugins/google-listings-and-ads/src/Jobs/UpdateAllProducts.php(20): Automattic\Jetpack\Autoloader\jpf11009ded9fc4592b6a05b61ce272b3c_jetpackⓥ13_5\al3_0_8\PHP_Autoloader::load_class('Automattic\\WooC...') #4 /htdocs/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php(90): require('/htdocs/wp-cont...') #5 [internal function]: Automattic\Jetpack\Autoloader\jpf11009ded9fc4592b6a05b61ce272b3c_jetpackⓥ13_5\al3_0_8\PHP_Autoloader::load_class('Automattic\\WooC...') #6 /htdocs/wp-content/plugins/google-listings-and-ads/src/Exception/ValidateInterface.php(22): class_implements('Automattic\\WooC...') #7 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/JobServiceProvider.php(181): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\JobServiceProvider->validate_interface('Automattic\\WooC...', 'Automattic\\WooC...') #8 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/JobServiceProvider.php(99): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\JobServiceProvider->share_product_syncer_job('Automattic\\WooC...') #9 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php(102): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\JobServiceProvider->register() #10 /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...') #11 /htdocs/wp-content/plugins/google-listings-and-ads/src/Container.php(90): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #12 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(130): Automattic\WooCommerce\GoogleListingsAndAds\Container->get('Automattic\\WooC...') #13 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(91): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->maybe_register_services() #14 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\{closure}('') #15 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #16 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #17 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #18 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #19 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #20 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #21 /htdocs/index.php(17): require('/htdocs/wp-blog...') #22 {main} thrown in /htdocs/wp-content/plugins/google-listings-and-ads/src/Jobs/AbstractBatchedActionSchedulerJob.php on line 22