pping method to its related shipping locations. * * @param ShippingRate[] $shipping_rates The shipping rates. * @param ShippingLocation[] $locations The shipping locations. * * @since 2.1.0 */ protected 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 /data/b/9/b926ebc9-f7f8-4503-89fb-c680310be954/flukoland.sk/web/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 /data/b/9/b926ebc9-f7f8-4503-89fb-c680310be954/flukoland.sk/web/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73
pping method to its related shipping locations. * * @param ShippingRate[] $shipping_rates The shipping rates. * @param ShippingLocation[] $locations The shipping locations. * * @since 2.1.0 */ protected 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; } } }