Created
June 3, 2015 03:37
-
-
Save WillBrubaker/4d9f1cd122513e9eb0bc to your computer and use it in GitHub Desktop.
Restrict WooCommerce order notes field to a number of characters
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
add_filter( 'woocommerce_checkout_fields', 'filter_checkout_fields' ); | |
function filter_checkout_fields( $fields ) { | |
$fields['order']['order_comments']['maxlength'] = 200; | |
return $fields; | |
} |
Seems you probably have some troubleshooting to do. Here is where the filter is called in WooCommerce 3.6.5 https://github.com/woocommerce/woocommerce/blob/3.6.5/includes/class-wc-checkout.php#L265
Seems you probably have some troubleshooting to do. Here is where the filter is called in WooCommerce 3.6.5 https://github.com/woocommerce/woocommerce/blob/3.6.5/includes/class-wc-checkout.php#L265
Do you mind sharing the code we should use?
@yoske25 exactly as written above:
becuase i have a pugin that modifies the checkout as well, my modifications did not display, but when i deactivated the plugin it worked ! :D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I've tried this and didn't work in my WooCommerce installation (using version 3.6.5 and WordPress 5.2.2).
Any suggestions?