diff --git a/modules/ppcp-compat/services.php b/modules/ppcp-compat/services.php index cb21e195b..c1bab8b74 100644 --- a/modules/ppcp-compat/services.php +++ b/modules/ppcp-compat/services.php @@ -54,18 +54,6 @@ return array( ); }, - 'compat.gzd.is_supported_plugin_version_active' => function (): bool { - return function_exists( 'wc_gzd_get_shipments_by_order' ); // 3.0+ - }, - - 'compat.wc_shipment_tracking.is_supported_plugin_version_active' => function (): bool { - return class_exists( 'WC_Shipment_Tracking' ); - }, - - 'compat.ywot.is_supported_plugin_version_active' => function (): bool { - return function_exists( 'yith_ywot_init' ); - }, - 'compat.module.url' => static function ( ContainerInterface $container ): string { /** * The path cannot be false. diff --git a/modules/ppcp-order-tracking/services.php b/modules/ppcp-order-tracking/services.php index df4b6bf71..5d938645b 100644 --- a/modules/ppcp-order-tracking/services.php +++ b/modules/ppcp-order-tracking/services.php @@ -96,10 +96,20 @@ return array( $logger = $container->get( 'woocommerce.logger.woocommerce' ); $endpoint = $container->get( 'order-tracking.endpoint.controller' ); - return array( - new GermanizedShipmentIntegration( $shipment_factory, $logger, $endpoint ), - new ShipmentTrackingIntegration( $shipment_factory, $logger, $endpoint ), - new YithShipmentIntegration( $shipment_factory, $logger, $endpoint ), - ); + $integrations = array(); + + if ( function_exists( 'wc_gzd_get_shipments_by_order' ) ) { + $integrations[] = new GermanizedShipmentIntegration( $shipment_factory, $logger, $endpoint ); + } + + if ( class_exists( 'WC_Shipment_Tracking' ) ) { + $integrations[] = new ShipmentTrackingIntegration( $shipment_factory, $logger, $endpoint ); + } + + if ( function_exists( 'yith_ywot_init' ) ) { + $integrations[] = new YithShipmentIntegration( $shipment_factory, $logger, $endpoint ); + } + + return $integrations; }, );