View Categories

How to Repeat a Checkout Field for Each Product in the Cart

To ask for the same information about every product a customer is buying, use the Duplicate option in Custom Checkout Fields for WooCommerce. One field definition becomes a separate copy per product, or per product item, in the cart.

When to use it #

  • An engraving message for each engraved item.
  • A delivery date for each product shipped separately.
  • A name for each ticket or seat in the order.

Set the duplicate mode #

  1. Go to WPFactory > Custom Checkout Fields (also reachable at WooCommerce > Settings > Custom Checkout Fields).
  2. Open the field tab and set Duplicate (alg_wc_ccf_duplicate_1) to one of:
    • Do not duplicate (default): one field, as normal.
    • For each product in cart: one copy per distinct product line.
    • For each product item in cart: one copy per unit, so a quantity of 3 gives 3 copies.

Label the copies #

The copies are labeled using templates on the General tab, under Advanced Options:

Label Option ID Default
For each product in cart alg_wc_ccf_duplicate_label_template_each_product %product_title%
For each product item in cart alg_wc_ccf_duplicate_label_template_each_product_item %product_title% (%item_nr%)
Glue alg_wc_ccf_duplicate_label_glue :

Placeholders: %product_title% is the product name, and %item_nr% is the item number within that product line. The Glue joins the field’s own label to the product suffix, so a field labeled “Engraving” with the default glue reads “Engraving: T-Shirt (2)”.

Notes #

  • Each copy is saved separately on the order under its own meta key. See Where custom field data is stored on the order.
  • Country locale handling is not applied to duplicated fields, so avoid the Country and State types with Duplicate.

Get more fields #

Duplicate works on your single free field. Custom Checkout Fields for WooCommerce Pro lets you add up to 100 fields, so you can combine per-product fields with regular ones. See what Pro unlocks.