Codeinwp / Codeinwp/woocommerce-product-addon

Add Display Text field type for static read-only product page information

Open
#550 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

medium new feature
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"> with wp_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 in ppom_array_all_inputs() core array
  • classes/ppom.class.php — skip in has_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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.