Codeinwp / Codeinwp/woocommerce-product-addon
Add Display Text field type for static read-only product page information
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 15
- Forks
- 9
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 16
Description
Problem
No field type exists for showing read-only information (ship dates, disclaimers, batch numbers) on the product page without creating an editable input.
Solution
New display input type:
- Admin: textarea for display content, CSS class option, visibility settings
- Frontend: renders as
<div class="ppom-display-text">withwp_kses_post()sanitization - Does NOT submit data to cart (no
<input>element in template)
Files Affected
- New:
classes/inputs/input.display.php— input class - New:
templates/frontend/inputs/display.php— frontend template inc/arrays.php— register inppom_array_all_inputs()core arrayclasses/ppom.class.php— skip inhas_unique_datanames()check
Acceptance Criteria
- "Display Text" appears in field type picker
- Renders as read-only text on product page
- Does NOT appear in cart, checkout, or order details
- HTML content properly sanitized via
wp_kses_post()
Priority: Low — single user request, nice-to-have
Regression risk: Isolated — new field type
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing existing input classes in classes/inputs and frontend templates in templates/frontend/inputs, then trace registration through inc/arrays.php and the has_unique_datanames() check in classes/ppom.class.php. Add the new display type in the named files and verify the picker, sanitized read-only rendering, and absence from cart, checkout, and order details.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100