• Resolved raph31

    (@raph31)


    Hello, I’m using a custom checkout plugin and I setup the plugin so that some of the custom fields are displayed depending on selected donation product. The donation form is integrated into the page thanks to a shortcode. However, when loading the page for the first time, the conditional fields are not displayed correctly. It looks like the cart is still empty when they are tested. Here is an example page, the conditional field is the last checkbox in the checkout : https://www.archipelcitoyen.org/accueil/adherer-a-archipel-citoyen/. Any idea or workaround ?

    Thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Conditional fields in Checkout form’ is closed to new replies.