Listen for tracking from module

This commit is contained in:
Narek Zakarian 2022-08-16 16:49:16 +04:00
parent 28af99e71f
commit 43095654ff

View file

@ -21,6 +21,7 @@ use WooCommerce\PayPalCommerce\OrderTracking\Endpoint\OrderTrackingEndpoint;
use WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException;
use WooCommerce\PayPalCommerce\WcGateway\Helper\PayUponInvoiceHelper;
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
use WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsListener;
/**
* Class OrderTrackingModule
@ -62,6 +63,14 @@ class OrderTrackingModule implements ModuleInterface {
$settings->persist();
}
/**
* The settings listener.
*
* @var SettingsListener $listener
*/
$listener = $c->get( 'wcgateway.settings.listener' );
$listener->listen_for_tracking_enabled();
$tracking_enabled = $settings->has( 'tracking_enabled' ) && $settings->get( 'tracking_enabled' );
if ( ! $tracking_enabled ) {