WooWeekly #318: Checkout Fields, Bug Reporting

How you doing?

It’s a busy Wednesday here in Sicily, Italy. We’re currently looking at properties in Palermo hoping we can move in before our life “changes” – so far it’s been hard to find what we wanted, where we wanted and for how much we wanted, so there is always a huge compromise to make. We made an offer for a house yesterday but didn’t have any previous experience so it was a bit weird. Is real estate agent commission 4% where you live as well?

Anyhow, welcome back to our WooCommerce Weekly appointment – here comes a series of WooCommerce tutorials put together by yours truly so that you can learn something new.

New WooCommerce Tips

WooCommerce: Maxlength and Minlength for Checkout Fields

If you’re familiar with HTML, you can add “maxlength” and “minlength” attributes to an input field in order to force its value to be min X and max Y characters long. This is all good and easy, so we might as well see what happens on the WooCommerce Checkout page once we apply such attributes to a given custom field. Spoiler alert: maxlength works, while minlength does not. Hence, forcing a given checkout field to have a minimum length is actually quite impossible, unless we validate the posted data (a field input value that is not long enough) once the checkout is submitted. That’s a bummer, and in this article I will also explain how to contact WooCommerce so they can improve a functionality / fix a bug. Enjoy: https://www.businessbloomer.com/woocommerce-maxlength-minlength-checkout-fields/

Author

  • Rodolfo Melogli

    Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

    View all posts

Proudly supported by

Join them?