Codeinwp / Codeinwp/woocommerce-product-addon
Improve notice message for Min/Max options for the Checkbox field
Nobody has claimed this yet.
- 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
- Add a Checkbox field with two options A and B
- Set the Min and Max values to 1
- Attach the PPOM field to a product
- try to add the product in the cart, with both A and B selected
- 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
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
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
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