diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index bae874f7e..422c54d27 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -949,8 +949,8 @@ return array( 'title' => __( 'Tracking', 'woocommerce-paypal-payments' ), 'type' => 'checkbox', 'desc_tip' => true, - 'label' => __( 'Enable tracking', 'woocommerce-paypal-payments' ), - 'description' => __( 'Enable tracking', 'woocommerce-paypal-payments' ), + 'label' => $container->get( 'wcgateway.settings.tracking-label' ), + 'description' => __( 'Allows to send shipment tracking numbers to PayPal for PayPal transactions.', 'woocommerce-paypal-payments' ), 'default' => false, 'screens' => array( State::STATE_ONBOARDED, @@ -2456,10 +2456,33 @@ return array( return true; } - if ( $pui_helper->is_pui_ready_in_admin() ) { + if ( $pui_helper->is_pui_enabled() ) { return true; } return false; }, + 'wcgateway.settings.tracking-label' => static function ( ContainerInterface $container ): string { + $tracking_label = __( 'Enable tracking information feature on your store.', 'woocommerce-paypal-payments' ); + $is_tracking_available = $container->get( 'order-tracking.is-tracking-available' ); + + if ( $is_tracking_available ) { + return $tracking_label; + } + + $tracking_label .= sprintf( + // translators: %1$s and %2$s are the opening and closing of HTML tag. + __( + ' To use tracking features, you must %1$senable tracking on your account%2$s.', + 'woocommerce-paypal-payments' + ), + '', + '' + ); + + return $tracking_label; + }, );