Lorixen.
EN

Adding a Custom Text Field to Shopify Product Pages

Short answer: Shopify stores custom text with an order through "line item properties": any input on the product page named properties[Something] that is linked to the add-to-cart form gets saved against that cart line. In an Online Store 2.0 theme you can add one with a Custom Liquid block in the theme editor, or install a product options app if you need conditional fields, file uploads or price add-ons. Make the field required where it matters, set a character limit, then check the text appears in the cart, the order in admin and your packing slip.

What line item properties are

When a customer adds a product to the cart, Shopify can attach extra key and value pairs to that line. For example, Engraving: For Sam, 2026 or Ring size: N. These are line item properties. They travel with the item into checkout and the order, and you can print them on packing slips. The Liquid line item reference lists the properties field alongside the other line data.

Because properties are stored per line, two of the same mug with different names on them become two separate cart lines. That is exactly what you want for personalised goods.

Option 1: Custom Liquid block in the theme editor

This works in Dawn and most free Shopify themes released since Online Store 2.0.

  1. Go to Online Store, then Themes, and choose Customise on your live theme. Better still, duplicate the theme first and work on the copy.
  2. Open a product page template. If only some products are personalised, create a separate template, for example product.engraved, and assign it to those products.
  3. In the Product information section, add a block called Custom Liquid and drag it above the Buy buttons.
  4. Paste a field like this:
<label for="engraving-{{ section.id }}">Engraving text (max 20 characters)</label>
<input
  id="engraving-{{ section.id }}"
  type="text"
  name="properties[Engraving]"
  maxlength="20"
  required
  form="product-form-{{ section.id }}">

The form attribute connects the input to the add-to-cart form even though it sits in a different block. Check your theme's product form ID: in Dawn it follows the product-form- plus section ID pattern, but other themes may differ. Inspect the page or ask the theme developer if the text does not reach the cart.

  1. Save, then test on the preview.

Other field types

  • Dropdown for fixed choices: a select with name="properties[Font]".
  • Textarea for longer messages, such as a card note.
  • Number for measurements, with min and max set.
  • Checkbox for gift wrap, though gift wrap with a charge is usually better as its own product.

Hidden properties

A property name that begins with an underscore, for example properties[_batch], is typically hidden from the customer at checkout. Use this only for internal notes your fulfilment process needs.

Option 2: Product options apps

Choose an app from the Shopify App Store when you need:

  • Fields that appear only after another choice, such as "Add engraving? Yes" revealing the text box
  • Photo or file uploads
  • Live previews of the personalised item
  • Extra charges for personalisation
  • The same set of fields applied to many products at once

Apps usually create line item properties too, so the order data looks similar. Review how each app loads on the storefront, because some add noticeable script weight, and check what happens to existing fields if you uninstall it.

Required fields and character limits

Validation protects you from orders you cannot fulfil:

  • required stops the add-to-cart until the field is filled. Test it, because some themes add to cart with JavaScript and may bypass browser validation if the field is not linked correctly.
  • maxlength matches the physical limit of what you can engrave, print or embroider.
  • pattern can restrict characters, for example letters and spaces only, if your machine cannot handle symbols or emoji.

Tell customers the limit in the label, not only in an error message. "Up to 20 letters, no symbols" prevents disappointment.

Making sure the text shows everywhere

Test the full journey with a real order using a discount code or a test payment method:

  1. Cart page and drawer. Dawn shows properties under the product name. If yours does not, the cart template needs a small loop over item.properties.
  2. Checkout summary. Properties appear under the item.
  3. Order in admin. Open the order; properties show under the line item.
  4. Order confirmation email. Check the notification template includes them.
  5. Packing slip. Go to Settings, then Shipping and delivery, then Packing slips, and edit the template. Shopify's packing slip help page explains where it lives. Add a loop over line_item.properties if your template does not already print them.

The packing slip is the step most often forgotten, and it is the one your workshop actually reads.

Charging for personalisation

Line item properties do not change the price on their own. Practical approaches:

  • Variant pricing. Create variants like "Plain" and "Engraved" with different prices, and show the text field only for the engraved option.
  • Add-on product. A hidden "Engraving" product added alongside, either by an app or a short script.
  • App pricing. Many options apps add the charge for you.

Whichever you choose, make sure the surcharge is visible before checkout so customers are not surprised.

FAQ

Can customers edit the text after adding to cart?

Not by default. They remove the item and add it again with new text. Some apps and custom cart code allow editing.

Will the text appear on invoices from apps?

Usually yes, if the invoice app reads line item properties. Test with one order before relying on it.

Does the custom field work with Shop Pay and express checkout?

Properties added through the product form carry into checkout. Dynamic express buttons on the product page can skip your field, so test them or hide them on personalised products.

Can we limit the field to some products only?

Yes. Use a separate product template containing the block and assign it only to personalised products.

If you sell personalised products and want the whole flow built and tested, send us the details and we will set it up for your shop.

Sources

WhatsAppBook a call