mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-08 21:52:55 +08:00
Uncheck onboarding with pui checkbox by default
This commit is contained in:
parent
a28dcffbf3
commit
1dec304595
2 changed files with 14 additions and 3 deletions
|
@ -80,10 +80,16 @@ class OnboardingOptionsRenderer {
|
||||||
*/
|
*/
|
||||||
private function render_pui_option(): string {
|
private function render_pui_option(): string {
|
||||||
if ( 'DE' === $this->country ) {
|
if ( 'DE' === $this->country ) {
|
||||||
$checked = 'checked';
|
$checked = '';
|
||||||
if ( $this->settings->has( 'ppcp-onboarding-pui' ) && $this->settings->get( 'ppcp-onboarding-pui' ) !== '1' ) {
|
try {
|
||||||
|
$onboard_with_pui = $this->settings->get( 'ppcp-onboarding-pui' );
|
||||||
|
if ( $onboard_with_pui === '1' ) {
|
||||||
|
$checked = 'checked';
|
||||||
|
}
|
||||||
|
} catch ( NotFoundException $exception ) {
|
||||||
$checked = '';
|
$checked = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return '<li><label><input type="checkbox" id="ppcp-onboarding-pui" ' . $checked . '> ' .
|
return '<li><label><input type="checkbox" id="ppcp-onboarding-pui" ' . $checked . '> ' .
|
||||||
__( 'Onboard with Pay upon Invoice', 'woocommerce-paypal-payments' ) . '
|
__( 'Onboard with Pay upon Invoice', 'woocommerce-paypal-payments' ) . '
|
||||||
</label></li>';
|
</label></li>';
|
||||||
|
|
|
@ -189,7 +189,12 @@ class PayUponInvoice {
|
||||||
add_filter(
|
add_filter(
|
||||||
'ppcp_partner_referrals_data',
|
'ppcp_partner_referrals_data',
|
||||||
function ( array $data ): array {
|
function ( array $data ): array {
|
||||||
if ( $this->settings->has( 'ppcp-onboarding-pui' ) && $this->settings->get( 'ppcp-onboarding-pui' ) !== '1' ) {
|
try {
|
||||||
|
$onboard_with_pui = $this->settings->get( 'ppcp-onboarding-pui' );
|
||||||
|
if ( $onboard_with_pui !== '1' ) {
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
} catch ( NotFoundException $exception ) {
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue