• Resolved zackeryfretty

    (@zackeryfretty)


    Hello! I’m trying to filter the “order_comments” field to add a max length, however, with this plugin active it doesn’t seem to want to work for me.

    Here’s the function I am using:

    add_filter( 'woocommerce_order_fields', 'limit_checkout_fields', 2000 );
    
    function limit_checkout_fields( $fields ) {
    	$fields['order']['order_comments']['maxlength'] = 115;
    	return $fields;
    }

    Is there something I am doing wrong here?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    We could see that the filter used in the code is incorrect. You are using the filter “woocommerce_order_fields“ and this is not a valid filter for the WooCommerce. Please use the filter “woocommerce_checkout_fields“ to modify the field property.

    We hope this will help ??

    Thank you!

    Thread Starter zackeryfretty

    (@zackeryfretty)

    Silly me, thank you that worked!

    Plugin Author ThemeHigh

    (@themehigh)

    Great!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filtering order_comments Field?’ is closed to new replies.