Plugin Author
Jonas
(@flinnn)
Hi raph31,
thanks for reaching out.
I can understand your problem, the plugin was not designed to work with such use-cases. You could try adding the checkbox to the payment section as this part is reloaded when the donation product is added to the cart.
Best,
Jonas
Thread Starter
raph31
(@raph31)
Thanks for your answer. I cannot implement the solution you propose because the plugin I use doesn’t allow to add conditional fields in the payment section. Don’t you think I could add the product to the cart with JS when the page is loaded ?
Plugin Author
Jonas
(@flinnn)
Well your solution will most likely not work because adding it using js means adding it after your shortcode executed 😉
I guess you can ask ChatGPT for a code snippet that adds the checkbox to the WooCommerce payment section.
Best,
Jonas
Hello, I have a similar problem, but in my case it is in the payment section. I’m using the “Flexible Checkout Fields for WooCommerce” plugin, with which you can set conditional logic to display a checkout field based on the product in the cart. Here is a screenshot: https://ibb.co/9cM9J53
In this case, I have set the “Nombre de la empresa” field to only show on a product called “Empresa” and not the others, but it only works if I refresh the page. You can see it working here: https://fundaciongaem.org/nueva/colabora/hazte-socio-particular/
If you change from “Particular” to “Empresa” and vice versa you will see that the field appears to be displayed randomly, and only displays or not correctly when you refresh the page. It happens both when I insert the product with a shortcode (the previous example) and in the product URL:
https://fundaciongaem.org/nueva/producto/donacion-empresa/
https://fundaciongaem.org/nueva/producto/donacion-particular/
Any idea why it happens?
Thank you, great plugin.