Tagged: Woocommerce Checkout
Hello
I try to add a checkbox tho the checkout form of the woo commerce shop. The checkbox should indicate the consent to forward the email adress to the delivery service.
The site https://shop-en.sonnenmulde.at/kasse/ shows a nice checkout form and I only want to add a field there:
What I already tried:
Since it is apparently a block based component the classic checkout and adding a checkbox via functions.php did not work
I tried to use the custom blocks plugin which gets installed if I switch in enfold to the block based editor but this ruins the layout
I tried to create some javascript to inject the checkbox, which worked but I was not able to receive the value of it into my backend.
Any suggestions on how I can add a non mandatory checkbox to the checkout field and receive its value into the order backend ?
Hey hubertba,
Thank you for the inquiry.
Have you tried using the woocommerce_checkout_fields filter? Please check this documentation for more info: https://developer.woocommerce.com/docs/code-snippets/customising-checkout-fields/
You can also try the following plugin: https://wordpress.org/plugins/woo-checkout-field-editor-pro/
Best regards,
Ismael
Hello
As I mentioned above, the woocommerce_checkout_fields filter does not work because the theme uses a Block Editor Style and Layout and not a classic one,
But.
The plugin solved the problem. I tried with other plugins which were not helping … but that one does.
Thank you!