/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/



// Add an email confirmation field to the checkout page
add_filter( 'woocommerce_checkout_fields' , 'custom_checkout_email_confirmation_field' );
function custom_checkout_email_confirmation_field( $fields ) {
    $fields['billing']['billing_email_confirm'] = array(
        'type'        => 'email',
        'label'       => __('Potvrdite e-mail adresu'),
        'placeholder' => _x('Potvrdite e-mail adresu', 'placeholder', 'woocommerce'),
        'required'    => true,
        'class'       => array('form-row-wide'),
        'clear'       => true,
        'priority'    => 999,
    );
    return $fields;
}

// Check if the email confirmation field matches the billing email field
add_action('woocommerce_checkout_process', 'custom_checkout_email_confirmation_validation');
function custom_checkout_email_confirmation_validation() {
    if (isset($_POST['billing_email_confirm']) && trim($_POST['billing_email_confirm']) !== trim($_POST['billing_email'])) {
        wc_add_notice( __( 'Your email and email confirmation do not match!' ), 'error' );
    }
}

/*************** ADD CUSTOM CSS HERE.   ***************/


@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/


}