services to check if supported 3rd party is active.

This commit is contained in:
Narek Zakarian 2023-10-16 16:32:09 +04:00
parent 8c8cbc6153
commit 4bfde190ec
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
2 changed files with 25 additions and 9 deletions

View file

@ -96,17 +96,21 @@ return array(
$logger = $container->get( 'woocommerce.logger.woocommerce' );
$endpoint = $container->get( 'order-tracking.endpoint.controller' );
$is_gzd_active = $container->get( 'compat.gzd.is_supported_plugin_version_active' );
$is_wc_shipment_active = $container->get( 'compat.wc_shipment_tracking.is_supported_plugin_version_active' );
$is_yith_ywot_active = $container->get( 'compat.ywot.is_supported_plugin_version_active' );
$integrations = array();
if ( function_exists( 'wc_gzd_get_shipments_by_order' ) ) {
if ( $is_gzd_active ) {
$integrations[] = new GermanizedShipmentIntegration( $shipment_factory, $logger, $endpoint );
}
if ( class_exists( 'WC_Shipment_Tracking' ) ) {
if ( $is_wc_shipment_active ) {
$integrations[] = new ShipmentTrackingIntegration( $shipment_factory, $logger, $endpoint );
}
if ( function_exists( 'yith_ywot_init' ) ) {
if ( $is_yith_ywot_active ) {
$integrations[] = new YithShipmentIntegration( $shipment_factory, $logger, $endpoint );
}