Direct answer
To collect a name or short message for a WooCommerce product, add one bounded plain-text field to the normal product form, validate it on the server, attach the sanitized value to that cart line, expose it through native item data, and copy it to the order item when WooCommerce creates the order. Do not trust a browser-only field and do not change price, stock, totals, payment, or order status for a text-only job.
StoreFixKit's Personalization Text Box for WooCommerce uses that narrow model. Free adds one product-specific field. Pro reuses up to three short fields by category or tag.
Begin with the actual merchant job
Personalized products range from engraved gifts to printed clothing, event badges, cake messages, and made-to-order labels. The merchant may need only one fact: the exact short wording the shopper supplied for this line item.
That is different from building a general product-options system. WooCommerce's official Product Add-Ons covers a much broader set of option types and pricing behavior. A merchant who needs uploads, calculations, dates, colors, checkboxes, conditional logic, or option prices should choose a product designed and tested for those jobs.
A focused text plugin should resist silently growing into that larger compatibility surface.
Why the field must belong to the cart line
A product setting says what question to ask. The shopper answer belongs to the selected cart line. Saving the answer back to the product would mix one customer's instruction with every later shopper and would be a serious ownership error.
WooCommerce's Store API cart documentation describes cart items as individual product or variation lines with item data. The server-side cart line is therefore the right temporary owner before an order exists.
When WooCommerce creates the order, the answer should become ordinary order-item metadata. That keeps the fulfillment fact beside the purchased item and lets standard admin and email output render it without a parallel customer database.
Keep different answers as different cart lines
If two shoppers' choices were irrelevant, WooCommerce could merge equal products into one line and increase quantity. For personalization, two copies of the same product may carry Alice and Bob; merging them would destroy the instruction-to-item relationship.
A deterministic line hash based on the sanitized answers makes the two configurations distinct without changing the product, variation, price, or stock. Equal answers can still follow WooCommerce's normal line behavior.
Validate on the server
HTML attributes such as required and maxlength improve the browser experience, but they are not an authorization or integrity boundary. Requests can bypass browser validation.
The add-to-cart handler should independently verify:
- the product has a valid enabled configuration;
- the request includes the plugin nonce;
- a required answer is not empty;
- the sanitized answer fits the merchant's saved 1 to 120 character limit.
When validation fails, reject only that add-to-cart request with a useful field-specific message. Do not invalidate an existing cart or block checkout after another line has already been accepted.
Preserve the exact useful text without accepting markup
The purpose is plain text, not HTML. Sanitize the submitted value as text, enforce a small character bound, and escape it again wherever it is displayed. Do not execute shortcodes or accept links, scripts, styling, or hidden fields inside the answer.
This protects the order interface while preserving the words the merchant needs. It also makes the data model understandable during support and export.
Email and app complaints reveal an ownership problem
Public support threads for larger add-on plugins include reports such as field data not consistently appearing in order emails and custom add-on data missing from emails or the WooCommerce app. These reports do not prove one universal cause, but they show why the final order item must be the durable source of truth.
If a value exists only in browser state, a plugin option, or an external service, later order surfaces may not know it exists. Standard order-item metadata gives WooCommerce and compatible templates a familiar place to find the value.
Simple and variable products
For a simple product, the configuration belongs to that product. For a variable product, the selected variation still shares the product form and cart-line lifecycle. The value should follow the exact selected line without rewriting variation attributes.
This first release deliberately does not provide a separate configuration matrix for every variation. That matrix would multiply editor states, fallbacks, and support cases. A merchant can use the parent product's explicit field or a bounded Pro category or tag assignment.
What Free and Pro should add
Free should solve the complete one-product job: label, optional or required choice, character limit, cart line, checkout display, and historical order item.
Pro can add capacity while preserving the same mental model:
- up to three short text questions;
- reusable category or tag assignments;
- explicit product exceptions.
Price add-ons, uploads, dates, color swatches, calculations, and remote storage are separate jobs. Adding them under the same setting page would make failure and rollback harder to reason about.
Privacy and retention
A personalization answer may contain a person's name, relationship, event, or other personal detail. The merchant should collect only what fulfillment needs and apply the same retention and erasure policy used for WooCommerce orders.
The plugin does not need analytics, a shopper cookie, or a copy of the answer on StoreFixKit servers. License checks should concern only Pro entitlement and should never include the customer answer.
Safety and resource boundaries
The product page can render the field from already loaded product configuration. The plugin needs no frontend JavaScript or stylesheet. It creates no custom table, cron job, analytics event, remote request, or add-to-cart database write.
It must not change product price, stock, visibility, totals, tax, shipping, coupons, payment, order status, fulfillment, refunds, or subscriptions. If configuration cannot be proven valid, render nothing and leave WooCommerce's normal path unchanged.
The Personalization Text documentation contains the exact setup, privacy, rollback, and uninstall workflow.
Beginner test checklist
Optional answer
Add the product with an empty answer. The cart should accept it and should not display an empty metadata row.
Required answer
Submit an empty answer. Only that add-to-cart attempt should fail with the configured field label.
Character limit
Submit exactly the limit and then one character more. The first should pass and the second should fail on the server.
Two different answers
Add the same product twice with different answers. The cart should keep two lines.
Order persistence
Place a test order and confirm the value appears on the order item. Deactivate the plugin and verify the historical value remains readable.
Missing WooCommerce or malformed settings
WordPress should keep loading. No field should appear and no unrelated request should be blocked.
Update and rollback
Downgrade to the previous known-good package and return to the current package. Product settings and historical order metadata should remain intact.
Security and support evidence
Only a user allowed to edit the product should change its field. Product saves need a capability check, nonce verification, sanitization, validation, and escaped output. WordPress's common plugin issues guide summarizes the review expectations around sanitizing, validating, and escaping data.
Useful support evidence includes the product ID, product type, field label, required choice, limit, WooCommerce and plugin versions, and screenshots before and after add to cart. Remove customer text, names, addresses, credentials, and full license keys.
Rollback boundary
Keep database and package backups. Deactivate Pro and Free, install the previous known-good versions, activate Free before Pro, and test optional, required, over-limit, and two-answer cases. Since historical answers live on WooCommerce order items and uninstall does not delete them, rollback should not require repairing old orders.
FAQ
Can the text change the product price?
No. This focused plugin never changes price or totals.
Will the answer appear on the order?
Yes. It is copied to ordinary WooCommerce order-item metadata after the line item is created.
Can shoppers upload a file?
No. File uploads have a different security, storage, retention, and email surface.
Does it work without JavaScript?
The plugin's own field, validation, cart data, and order-item flow are server rendered and require no plugin frontend script.
What happens when Pro expires?
Saved per-product Free fields continue working. Reusable Pro assignments become unavailable without deleting order data.
Focused plugin
Use the one-job implementation.
Add one short personalization text box to selected WooCommerce products and keep the shopper's exact answer with the cart line and order item.