Ajoutez ce code au fichier functions.php de votre thème, à la fin du fichier. Vous pouvez également trouver le fichier dans Appearance > Editor > Theme Functions (functions.php)
add_filter( 'woocommerce_billing_fields', 'bp_add_preorder_date_field_in_checkout',100 ); if( !function_exists( 'bp_add_preorder_date_field_in_checkout' ) ){ function bp_add_preorder_date_field_in_checkout( $fields ){ if ( 'no' === get_option( 'wc_preorders_always_choose_date' ) ) { $class = ['disabled-input', 'form-row-wide']; } else { $class = ['form-row-wide']; } $fields['preorder_date'] = [ 'label' => __( 'Pre order Date', 'preorders-for-woocommerce-pro' ), 'type' => 'text', 'class' => $class, 'description' => __( 'Please enter the date when you want to receive your order', 'preorders-for-woocommerce-pro' ), // 'input_class' => 'datepicker', 'priority' => 35, 'required' => true, 'default' => apply_filters( 'preorder_oldest_date', null ), 'custom_attributes' => ['data-pre_order_date' => apply_filters( 'preorder_oldest_date', '' )], ]; return $fields; } }