Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.