mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Get place order button label from filter
This commit is contained in:
parent
0a261a0de9
commit
8c7feb629d
2 changed files with 2 additions and 21 deletions
|
@ -27,24 +27,5 @@ window.addEventListener('load', function() {
|
|||
});
|
||||
|
||||
getSessionIdFromJson();
|
||||
|
||||
const replaceButtonLabel = () => {
|
||||
const form = document.querySelector('form.checkout');
|
||||
if(!form) {
|
||||
return;
|
||||
}
|
||||
|
||||
const buttonLabel = document.querySelector('#place_order')?.textContent;
|
||||
const buttonLegalTextLabel = document.querySelector('#ppcp-legal-text-button-label');
|
||||
if (buttonLabel && buttonLegalTextLabel) {
|
||||
buttonLegalTextLabel.textContent = '"' + buttonLabel + '"';
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(document.body).on('payment_method_selected', () => {
|
||||
replaceButtonLabel();
|
||||
});
|
||||
|
||||
replaceButtonLabel();
|
||||
})
|
||||
|
||||
|
|
|
@ -168,9 +168,9 @@ class PayUponInvoice {
|
|||
echo '</div><div>';
|
||||
$site_country_code = explode('-', get_bloginfo("language"))[0] ?? '';
|
||||
if($site_country_code === 'de') {
|
||||
_e( 'Mit Klicken auf <span id="ppcp-legal-text-button-label">den</span> Button akzeptieren Sie die <a href="https://www.ratepay.com/legal-payment-terms" target="_blank">Ratepay Zahlungsbedingungen</a> und erklären sich mit der Durchführung einer <a href="https://www.ratepay.com/legal-payment-dataprivacy" target="_blank">Risikoprüfung durch Ratepay</a>, unseren Partner, einverstanden. Sie akzeptieren auch PayPals <a href="https://www.paypal.com/de/webapps/mpp/ua/privacy-full?locale.x=de_DE&_ga=1.228729434.718583817.1563460395" target="_blank">Datenschutzerklärung</a>. Falls Ihre Transaktion per Kauf auf Rechnung erfolgreich abgewickelt werden kann, wird der Kaufpreis an Ratepay abgetreten und Sie dürfen nur an Ratepay überweisen, nicht an den Händler.', 'woocommerce-paypal-payments' );
|
||||
_e( 'Mit Klicken auf <span id="ppcp-legal-text-button-label">'.apply_filters( 'woocommerce_order_button_text', __( 'Place order', 'woocommerce' ) ).'</span> akzeptieren Sie die <a href="https://www.ratepay.com/legal-payment-terms" target="_blank">Ratepay Zahlungsbedingungen</a> und erklären sich mit der Durchführung einer <a href="https://www.ratepay.com/legal-payment-dataprivacy" target="_blank">Risikoprüfung durch Ratepay</a>, unseren Partner, einverstanden. Sie akzeptieren auch PayPals <a href="https://www.paypal.com/de/webapps/mpp/ua/privacy-full?locale.x=de_DE&_ga=1.228729434.718583817.1563460395" target="_blank">Datenschutzerklärung</a>. Falls Ihre Transaktion per Kauf auf Rechnung erfolgreich abgewickelt werden kann, wird der Kaufpreis an Ratepay abgetreten und Sie dürfen nur an Ratepay überweisen, nicht an den Händler.', 'woocommerce-paypal-payments' );
|
||||
} else {
|
||||
_e( 'By clicking on <span id="ppcp-legal-text-button-label">the</span> button, you agree to the <a href="https://www.ratepay.com/legal-payment-terms" target="_blank">terms of payment</a> and <a href="https://www.ratepay.com/legal-payment-dataprivacy">performance of a risk check</a> from the payment partner, Ratepay. You also agree to PayPal’s <a href="https://www.paypal.com/de/webapps/mpp/ua/privacy-full?locale.x=eng_DE&_ga=1.267010504.718583817.1563460395">privacy statement</a>. If your request to purchase upon invoice is accepted, the purchase price claim will be assigned to Ratepay, and you may only pay Ratepay, not the merchant.', 'woocommerce-paypal-payments' );
|
||||
_e( 'By clicking on <span id="ppcp-legal-text-button-label">'.apply_filters( 'woocommerce_order_button_text', __( 'Place order', 'woocommerce' ) ).'</span>, you agree to the <a href="https://www.ratepay.com/legal-payment-terms" target="_blank">terms of payment</a> and <a href="https://www.ratepay.com/legal-payment-dataprivacy">performance of a risk check</a> from the payment partner, Ratepay. You also agree to PayPal’s <a href="https://www.paypal.com/de/webapps/mpp/ua/privacy-full?locale.x=eng_DE&_ga=1.267010504.718583817.1563460395">privacy statement</a>. If your request to purchase upon invoice is accepted, the purchase price claim will be assigned to Ratepay, and you may only pay Ratepay, not the merchant.', 'woocommerce-paypal-payments' );
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue