BrightPlugins_Logo_Horizontal
Premium

How to fix YITH WOOCOMMERCE CHECKOUT MANAGER date conflict issue.

Add this code to the functions.php file of your theme, at the end of the file. You can also find the file in 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;
    }
}

Pre-orders for Woocommerce

 

 

Why preorders are marked as completed before the pre-order date arrives?>

BrightPlugins_Logo_Horizontal
Subscribe to our Newsletter

Subscribe

This field is for validation purposes and should be left unchanged.
Copyright © 2024 All Rights Reserved to Bright Plugins
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram