Replace no final review alert with description

This commit is contained in:
Alex P 2023-04-25 16:12:50 +03:00
parent 9d638a57e3
commit 47d6933288
No known key found for this signature in database
GPG key ID: 54487A734A204D71
2 changed files with 6 additions and 13 deletions

View file

@ -44,7 +44,12 @@ return array(
'blocks_final_review_enabled' => array(
'title' => __( 'Block Express payments Final Review', 'woocommerce-paypal-payments' ),
'type' => 'checkbox',
'label' => __( 'Require customers to confirm Block Express payments on the Checkout page. If disabled, the Checkout page is skipped for Block Express payments.', 'woocommerce-paypal-payments' ),
'label' => __(
'Require customers to confirm Block Express payments on the Checkout page.
If disabled, the Checkout page is skipped for Block Express payments.
<p class="description">This can cause issues and poor UX if the server is not handling the requests fast enough.</p>',
'woocommerce-paypal-payments'
),
'default' => true,
'screens' => array( State::STATE_START, State::STATE_ONBOARDED ),
'requirements' => array(),

View file

@ -19,18 +19,6 @@ import {setVisibleByClass, isVisible} from "../../../ppcp-button/resources/js/mo
const form = jQuery('#mainform');
// TODO: maybe move to a separate JS file in blocks module, when we need more JS for block settings
const finalReviewCheckbox = document.querySelector('#ppcp-blocks_final_review_enabled');
if (finalReviewCheckbox) {
finalReviewCheckbox.addEventListener('click', () => {
if (!finalReviewCheckbox.checked) {
if (!window.confirm('Are you sure you want to disable the final review on the Checkout page for Block Express payments?')) {
finalReviewCheckbox.checked = true;
}
}
});
}
const payLaterButtonInput = document.querySelector('#ppcp-pay_later_button_enabled');
if (payLaterButtonInput) {