Last active
October 10, 2021 16:55
-
-
Save rwsite/9bf120a5e35a18adb480e0b43ae03c07 to your computer and use it in GitHub Desktop.
woo2iiko default value for teminal's select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('iiko_checkout_fields', function ($fields){ | |
$fields['delivery_terminal']['default'] = ''; | |
$fields['delivery_terminal']['options'] = [''=>''] + $fields['delivery_terminal']['options']; | |
return $fields; | |
}, 10, 1 ); | |
add_action( 'woocommerce_after_checkout_validation', function ($data, \WP_Error $errors) { | |
if(isset($data['billing_delivery_terminal']) && empty($data['billing_delivery_terminal'])){ | |
$errors->add('iiko_terminal', __('Please select the terminal', 'iiko')); | |
} | |
return $data; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment