Hi @formazionecesal
I hope you are doing well.
Let me explain, to enable the Pay Later your form must match this requirement: https://developer.paypal.com/docs/checkout/pay-later/it/#link-eligibility
- You’re an Italy-based PayPal merchant.
- You have an Italy-facing website.
- You transact in euros (EUR).
- You have a one-time payment integration.
- You abide by the PayPal Acceptable Use Policy.
- You don’t edit Pay Later messages with additional content, wording, marketing, or other materials to encourage use of this product. PayPal reserves the right to take action in accordance with the PayPal User Agreement.
In case your form is not enabling this out of the box, please use the below code:
In case you are using Ajax loading: https://monosnap.com/file/qM4m9leeL0bQSFN5bZdKVfMrmoZAQD
<?php
add_filter( 'forminator_enqueue_form_scripts', 'wpmudev_add_paylater_funding', 10, 3 );
function wpmudev_add_paylater_funding( $scripts, $is_preview, $is_ajax_load ) {
if ( $is_ajax_load ) {
foreach ( $scripts as $handle => $script ) {
if ( $handle == 'forminator-paypal-343' ) {
$scripts[$handle]['src'] = $script['src'].'&enable-funding=paylater';
}
}
}
return $scripts;
}
Replace the 343 in the code using the ID found in the URL.
Add the code as a mu-plugin https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
If you are not using the Load from Ajax use this version instead:
<?php
function wpmudev_add_paylater_funding( $tag, $handle, $src ) {
if ( $handle == 'forminator-paypal-343' ) { //Change the form ID from 343 to your form's ID
$new_src = $src.'&enable-funding=paylater';
return str_replace( $src, $new_src, $tag );
}
return $tag;
}
add_filter( 'script_loader_tag', 'wpmudev_add_paylater_funding', 10, 3 );
But you still need to match that requirement of PayPal.
Let us know the result you got.
Best Regards
Patrick Freitas