mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-12 01:18:39 +08:00
Hide credit card options when checkbox is unchecked
This commit is contained in:
parent
80fad900b4
commit
fa41fd19a7
3 changed files with 7 additions and 6 deletions
|
@ -55,6 +55,7 @@ ul.ppcp-onboarding-options, ul.ppcp-onboarding-options-sublist {
|
||||||
|
|
||||||
ul.ppcp-onboarding-options-sublist {
|
ul.ppcp-onboarding-options-sublist {
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ppcp-muted-text {
|
.ppcp-muted-text {
|
||||||
|
|
|
@ -158,6 +158,8 @@ function ppcp_onboarding_productionCallback(...args) {
|
||||||
input.disabled = !cardsChk.checked;
|
input.disabled = !cardsChk.checked;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.querySelector('.ppcp-onboarding-cards-options').style.display = !cardsChk.checked ? 'none' : '';
|
||||||
|
|
||||||
const basicRb = document.querySelector('#ppcp-onboarding-dcc-basic');
|
const basicRb = document.querySelector('#ppcp-onboarding-dcc-basic');
|
||||||
|
|
||||||
const isExpress = !cardsChk.checked || basicRb.checked;
|
const isExpress = !cardsChk.checked || basicRb.checked;
|
||||||
|
|
|
@ -127,9 +127,9 @@ class OnboardingOptionsRenderer {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
$items[] = '
|
$items[] = '
|
||||||
<li ' . ( ! $is_shop_supports_dcc ? 'style="display: none;"' : '' ) . '>
|
<li>
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" id="ppcp-onboarding-dcc-basic" name="ppcp_onboarding_dcc" value="basic" ' .
|
<input type="radio" id="ppcp-onboarding-dcc-basic" name="ppcp_onboarding_dcc" value="basic" checked ' .
|
||||||
( ! $is_shop_supports_dcc ? 'checked' : '' ) .
|
( ! $is_shop_supports_dcc ? 'checked' : '' ) .
|
||||||
' data-screen-url="' . $this->get_screen_url( 'basic' ) . '"' .
|
' data-screen-url="' . $this->get_screen_url( 'basic' ) . '"' .
|
||||||
'> ' .
|
'> ' .
|
||||||
|
@ -184,7 +184,7 @@ class OnboardingOptionsRenderer {
|
||||||
$items[] = '
|
$items[] = '
|
||||||
<li>
|
<li>
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" id="ppcp-onboarding-dcc-acdc" name="ppcp_onboarding_dcc" value="acdc" checked ' .
|
<input type="radio" id="ppcp-onboarding-dcc-acdc" name="ppcp_onboarding_dcc" value="acdc" ' .
|
||||||
'data-screen-url="' . $this->get_screen_url( 'acdc' ) . '"> ' .
|
'data-screen-url="' . $this->get_screen_url( 'acdc' ) . '"> ' .
|
||||||
__( 'Advanced Card Processing', 'woocommerce-paypal-payments' ) . '
|
__( 'Advanced Card Processing', 'woocommerce-paypal-payments' ) . '
|
||||||
</label>
|
</label>
|
||||||
|
@ -201,9 +201,7 @@ class OnboardingOptionsRenderer {
|
||||||
implode( '', $items ) .
|
implode( '', $items ) .
|
||||||
'
|
'
|
||||||
</ul>
|
</ul>
|
||||||
<div class="ppcp-onboarding-cards-screen">' .
|
<div class="ppcp-onboarding-cards-screen"><img id="ppcp-onboarding-cards-screen-img" /></div>
|
||||||
( $is_shop_supports_dcc ? '<img id="ppcp-onboarding-cards-screen-img" />' : '' ) . '
|
|
||||||
</div>
|
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue