mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Check if 3rd parties are active before integration init.
This commit is contained in:
parent
e4534d64cd
commit
fedcc8f79a
2 changed files with 15 additions and 17 deletions
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue