Created
March 12, 2020 20:37
-
-
Save Njengah/efb43334af69ad53b09b7bf6088f5e99 to your computer and use it in GitHub Desktop.
Code snippet to create order comments field.
This file contains hidden or 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
<?php | |
//Create order comments field | |
if ( version_compare( WC_VERSION, '3.0', '<' ) ) { | |
$fields = WC()->checkout->checkout_fields['billing']; | |
} else { | |
$fields = WC()->checkout->get_checkout_fields( 'billing' ); | |
} | |
woocommerce_form_field( | |
'order_comments', | |
$fields['order_comments'], | |
WC()->checkout->get_value( 'order_comments') | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment