WordPress.org

Forums

MailPoet WooCommerce Add-on
[resolved] Checkbox set to "checked" by default (5 posts)

  1. MisterShmi
    Member
    Posted 2 years ago #

    Is there a way to have the checkbox "checked" by default? I didn't see this option anywhere. Thanks!

    https://wordpress.org/plugins/mailpoet-woocommerce-add-on/

  2. MailPoet
    Member
    Plugin Contributor

    Posted 1 year ago #

    Add this code to your footer.php file right below the call to wp_footer()

    <script>
    (function($){
    	$(document).ready(function(){
    
            $('#mailpoet_checkout_subscribe').prop('checked', true);
    
    	});
    })(window.jQuery);
    </script>
  3. mitmak
    Member
    Posted 1 year ago #

    Is there a way to have the checkbox "checked" by default on the CheckOut and New User Registration page using CSS only? Something like below?

    #mailpoet_checkout_subscribe {
    checked=true;
    }

  4. mitmak
    Member
    Posted 1 year ago #

    OR would any of the below work by adding to functions.php of the child theme?

    add_filter( 'mailpoet_woocommerce_subscribe_too', '__return_true' );
    add_filter( 'mailpoet_woocommerce_enable_checkout', '__return_true' );
    add_filter( 'mailpoet_checkout_subscribe', '__return_true' );

    Your inputs will be appreciated. Thanks much.

  5. derekakelly
    Member
    Posted 1 year ago #

    This should be a built in option!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • MailPoet WooCommerce Add-on
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.