ZeDaq.ai
Menswear shopper viewing a suit on a fashion store website

WooCommerce Custom Fields for Customer Measurements

By the ZeDaq.ai team · · 4 min read

On this page
  1. What are custom fields for measurements?
  2. Which route should you choose: plugin or code?
  3. How do you add measurement fields with a plugin?
  4. How do you add fields with code?
  5. How do you stop wrong measurements?
  6. Can you skip typed measurements altogether?

To collect customer measurements in WooCommerce, add custom fields to the product page, either with a product add-ons plugin or with a small code snippet, and make sure the values are saved to the order. The customer fills in chest, waist or length, and you see the numbers in the order screen and emails.

This guide covers both routes and the checks that stop bad data. If you also want shoppers to get a size suggestion without typing anything, see virtual try-on for WooCommerce.

What are custom fields for measurements?

They are extra inputs on the product page, such as "Chest (cm)", that the customer fills in before adding to cart. WooCommerce then stores the answer with that cart item and order line.

This is the standard way to sell made-to-measure items on WooCommerce, where one size label cannot describe the customer.

Which route should you choose: plugin or code?

Route Good for Trade-off
Product add-ons plugin Non-developers, quick setup Plugin cost and updates; check each plugin's own documentation
Custom code with WooCommerce hooks Developers, full control You maintain it and test it after updates

If you do not write code, use a plugin from a source you trust and read its documentation and reviews. The official WooCommerce Product Add-Ons extension is one place to start. Check its current price and features on that page, because they change. Our roundup of the best WooCommerce plugins for clothing shops covers other options.

How do you add measurement fields with a plugin?

The exact screens vary by plugin, but the steps are similar.

  1. Install and activate the plugin, then open a product or its global settings.
  2. Add a field for each measurement, using a number type where possible.
  3. Label each one clearly, with the unit in the label, for example "Waist (inches)".
  4. Mark the fields as required so the order cannot be placed with blanks.
  5. Add short help text or a link to a measuring guide.
  6. Place a test order and confirm the values appear on the order page and in the admin email.

How do you add fields with code?

Developers can use WooCommerce hooks. The usual pattern has four steps, described in the WooCommerce developer documentation:

  1. Show the input with an action such as woocommerce_before_add_to_cart_button.
  2. Validate the value with woocommerce_add_to_cart_validation.
  3. Attach it to the cart item with woocommerce_add_cart_item_data.
  4. Save it to the order line with woocommerce_checkout_create_order_line_item.

Test on a staging site first and use a child theme or a small custom plugin, so theme updates do not remove your code. For a hook example on the display side, the article on WooCommerce hooks for a try-on button shows how placement works.

How do you stop wrong measurements?

Free-text fields invite errors like "34" with no unit. A few rules fix most of it:

  • Use number inputs with a minimum and maximum that make sense.
  • State inches or centimeters in the label, or offer one unit only.
  • Show a short guide with a picture for each measurement.
  • Ask the customer to confirm their entries before checkout.
  • Offer a contact option for customers who are unsure.

Collecting data is only half the job. Customers still need to know how to measure, and our look at collecting measurements at checkout on Shopify shows the same principles on another platform.

Can you skip typed measurements altogether?

Sometimes. For ready-to-wear products, a size recommendation can replace typed numbers. The shopper uploads a photo and height, and the tool suggests a size from the store's own chart.

ZeDaq.ai offers this on WooCommerce through a script-tag widget that adds "Try it on" and "Find my size". It is not a WooCommerce plugin, and it does not replace custom fields for true made-to-measure orders, where you need exact numbers from each customer. Developers can also call the REST API, documented at the API reference.

For a full overview of other platforms, see try-on for WooCommerce, Magento and custom stores.

Connect fit tools to your WooCommerce store

FAQs

Do I need a plugin to add custom fields in WooCommerce?

No. You can add fields with code and hooks. A plugin is quicker if you do not write code.

Where will I see the measurements?

Saved values appear on the order line in the admin and can appear in order emails. Always place a test order to confirm.

Can customers save their measurements for next time?

That needs extra work, such as storing values in the customer account. Check whether your plugin supports it, or plan custom development.

Should I use inches or centimeters?

Use the unit your customers know best, and show it in the label. Offering both on one field invites mistakes.

Try ZeDaq.ai free

Virtual try-on and Find my size for your store, plus client, order and invoicing tools for tailors, in one subscription.

Related articles