• Hello i need some help making the checkbox checked, im using this code to insert the checkbox in the checkout on woocommerce. Somebody know what code can i use to make the checkbox checked?

    // Our hooked in function - $fields is passed via the filter!
    function custom_override_checkout_fields( $fields ) {
         $fields['billing']['mc4wp-try-subscribe'] = array(
        'label'     => __('Newsletter', 'woocommerce'),
        'type'=> 'checkbox',
        'required'  => false,
        'value' => '1',
        'class'     => array('form-row-wide'),
         );
    
         return $fields;
    }

    https://www.ads-software.com/plugins/mailchimp-for-wp/

Viewing 1 replies (of 1 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi there,

    I have no experience with the new WooCommerce fields API but tagged the topic with woocommerce, hopefully a Woo dev is able to take a look at it. Not sure if they support a checked or attr key.

Viewing 1 replies (of 1 total)
  • The topic ‘help getting checkbox checked’ is closed to new replies.