How to set a checkbox to be always checked? I'm using a plugin "Woocommerce product fee" that ads a fee to products. It has a checkbox that, when is checked it calculates the fees for every product added in the cart. What I want to achieve is to set this checkbox to be always checked for every product but I can't find the right way. I added $checked but nothing happens...
This is an extract of my code:
// Check Box - Fee Multiply Option
woocommerce_wp_checkbox( array(
'id'=> 'product-fee-multiplier[' . $variation->ID . ']',
'label' => __('Multiply Fee by Quantity', 'woocommerce-product-fees' ),
'value' => get_post_meta( $variation->ID, 'product-fee-multiplier', true ),
'wrapper_class' => "product-fee-multiplier" ,
'required' => true
), $checked );
do_action( 'wcpf_add_variation_settings' );
}
public function save_variation_settings_fields( $post_id ) {
$another_field_updated = false;
// Text Field - Fee Name
$product_fee_name_text_field = $_POST['product-fee-name'][ $post_id ];
if( ! empty( $product_fee_name_text_field ) || get_post_meta(
$post_id, 'product-fee-name', true ) != '' ) {
update_post_meta( $post_id, 'product-fee-name', esc_attr( $product_fee_name_text_field ) );
$another_field_updated = true;
}