e flat-rate shipping method. * * @param object|WC_Shipping_Method $method * * @return array A multidimensional array of shipping class rates. { * Array of shipping method arguments. * * @type string $class The shipping class slug/id. * @type float $rate The cost of the shipping method for the class in WooCommerce store currency. * } */ protected function get_flat_rate_method_class_rates( object $method ): array { $class_rates = []; $flat_cost = 0; $cost = $method->get_option( 'cost' ); // Check if the cost is a numeric value (and not null or a math expression). if ( is_numeric( $cost ) ) { $flat_cost = (float) $cost; } // Add shipping class costs. $shipping_classes = $this->wc->get_shipping_classes(); foreach ( $shipping_classes as $shipping_class ) { $shipping_class_cost = $method->get_option( 'class_cost_' . $shipping_class->term_id ); if ( is_numeric( $shipping_class_cost ) ) { // Add the flat rate cost to the shipping class cost. $class_rates[ $shipping_class->slug ] = [ 'class' => $shipping_class->slug, 'rate' => $flat_cost + (float) $shipping_class_cost, ]; } } return array_values( $class_rates ); } }
Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Shipping\ZoneMethodsParser 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\Integration\YoastWooCommerceSeo 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

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