Codeinwp / Codeinwp/woocommerce-product-addon

Improve notice message for Min/Max options for the Checkbox field

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

Nobody has claimed this yet.

bug customer report
Dominant language
PHP
Stars
15
Forks
9
Avg merge
3d 17h
Merged PRs (30d)
16

Description

Description

I think it's related to this issue https://github.com/Codeinwp/woocommerce-product-addon/issues/242

Reported by this user https://wordpress.org/support/topic/max-checked-option-not-working-2/, if you have a Checkbox field, and set some specific Min/Max options, when you try to add the Product in the Cart, when you are outside of the Min/Max options, you get the message "The field is a required field" instead of a more suggestive message like "You are allowed to choose only 1 option".

Step-by-step reproduction instructions
  1. Add a Checkbox field with two options A and B
  2. Set the Min and Max values to 1
  3. Attach the PPOM field to a product
  4. try to add the product in the cart, with both A and B selected
  5. You see the message "The field is required" instead of saying that you are not allowed to choose two options
Screenshots, screen recording, code snippet or Help Scout ticket

Image
Image

https://wordpress.org/support/topic/max-checked-option-not-working-2/

Environment info

No response

Is the issue you are reporting a regression

No

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

Reproduce the checkbox validation case with two options and Min/Max set to 1, following the steps in the issue. Locate the validation and notice-generation entry points for WooCommerce product fields; done means an over-limit selection produces a specific Min/Max message instead of saying the field is required.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.