You can achieve this by adding the following code to your theme's functions.php file:
add_filter( 'woocommerce_checkout_fields', 'mailpoet_optin_checked' );
function mailpoet_optin_checked( $fields ) {
$fields['mailpoet_optin']['default'] = 1;
return $fields;
}
This code will set the default value for the Mailpoet opt-in checkbox to 1 (checked) on the checkout page, even after refreshing the order review page.
Asked: 2021-10-31 11:00:00 +0000
Seen: 9 times
Last updated: Feb 09 '22