Hello @tw2021
The unchecked checkbox does not have the opposite value to the checked one. It is not possible to get this value.
There is a possible workaround.
Please uncheck the Display field label checkbox in the Display On tab.
Then go the General tab and add a Value that will determine whether the checkbox is selected or not e.g. I want an invoice. This Value is clear even without a label.
With the field set as above:
- when the user selects the checkbox then I want an invoice will appear (in the mail etc.)
- if the customer does not check the checkbox then nothing will appear (because the label is hidden and the value is missing)
Of course this is the solution when the goal is to mark (e.g. in the mail) whether the customer ticked the checkbox or not. But that will not solve the problem of the unchecked checkbox not having a value.
Thread Starter
tw2021
(@tw2021)
Hi Tomasz,
Thank you for the super fast response. Ah, yea the workaround won’t work because my checkout contains 3 questions which is a survey (can contain yes and no) that i would like to send to the orders page 🙁
Do you know if its even possible to modify the woocommerce default value of blank checked box to a value “No” by default?
Thank you.
Hello @tw2021
I do not know how to edit default checkboxes from WooCommerce because it is a different plugin.
If the question concerned our plugin – then the field template can be overwritten.
This the location of the file responsible for the checkbox:
wp-content/plugins/flexible-checkout-fields/templates/fields/inspirecheckbox.php
This template can be overridden by copying it to:
theme-name/flexible-checkout-fields/fields/inspirecheckbox.php
I am marking this topic as resolved as we have not received any new replies.