• Resolved yergomezz

    (@yergomezz)


    Hello,
    I want to limit the order_comments field to 20 characters. I have tried several codes but they don’t work, I don’t know if I’m doing it right.

    The field I want to limit is in the “additionald fields” tab and has the name “order_comments”.
    Could you explain me how to do it? Thank you.`

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

    (@themehigh)

    Unfortunately, there is no direct option available in the lite version of our plugin. However, you can achieve your requirement using the WooCommerce hook “woocommerce_after_checkout_validation”. You need to check the length of the field data in the callback function for that hook.

    We hope this will help.

    Thank you!

    Thread Starter yergomezz

    (@yergomezz)

    Can you please tell me how to use this hook? Thank you

    Thread Starter yergomezz

    (@yergomezz)

    Urgent, please. Can you help me?

    Plugin Author ThemeHigh

    (@themehigh)

    Can you please raise a ticket through our website? We hope our technical team will be able to help you.

    Thank you!

    Thread Starter yergomezz

    (@yergomezz)

    How do I register? Do I have to buy it to register?

    I just need this, which is a small detail and I think it should be solved from the free support as the other questions and as it happens in the other plugins.

    I just need to set a 44 character limit to a checkout field.

    If you need me to do it from your site, please tell me how to register.

    Plugin Author ThemeHigh

    (@themehigh)

    >> How do I register? Do I have to buy it to register?

    There is no need to buy our plugin inorder to rasie a ticket from our website.

    >> I just need this, which is a small detail and I think it should be solved from the free support as the other questions and as it happens in the other plugins.

    Since your requirement needs to be checked with our premium support team, we asked you to rasie a ticket.

    However, you can try the below code in your theme’s functions.php file.

    add_filter('woocommerce_checkout_fields','woo_checkout_fields_set_maxlength',99999);
    function woo_checkout_fields_set_maxlength($fields){
        if(isset($fields['order'])){
            $fields['order']['order_comments']['maxlength'] = 44;
        }
        return $fields;
    }

    We hope this will help.

    Thank you!

    Hello,
    I also have to put a limit of 10 characters in a Number field called billing_ceduladeidentidad, in the Billing and Shipping tabs.
    I’ve tried this solution but can’t get it to work.

    Can you help me?
    Thank you.
    Roberto

    Plugin Author ThemeHigh

    (@themehigh)

    @pzl Your requirement needs a detailed check. Can you please raise a ticket through our website? We hope our technical team will be able to help you.

    Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘limit 20 caracters to order_comments’ is closed to new replies.