Title: Two problems with conditional checkout fields
Last modified: November 29, 2024

---

# Two problems with conditional checkout fields

 *  Resolved [NCL](https://wordpress.org/support/users/nclnu/)
 * (@nclnu)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/two-problems-with-conditional-checkout-fields/)
 * I think I found 2 bugs when using wc-donation in combination with conditional
   checkout fields.
 * I’m using the plugin “Checkout Field Editor and Manager for WooCommerce – Pro”
   by Acowebs to make conditional checkout fields, but noticed the same behavior
   with other plugins ([https://wordpress.org/plugins/woocommerce-checkout-manager/](https://wordpress.org/plugins/woocommerce-checkout-manager/)).
 * I have 2 products, 1 simple subscription and 1 variable subscription. I want 
   to hide some fields for the variable subscription so that I get 2 different checkout
   experiences.
 * Simple subscription (Vriend):
 * ![](https://i0.wp.com/ncl.nu/temp/1.png?ssl=1)
 * Variable subscription (Donatie):
 * ![](https://i0.wp.com/ncl.nu/temp/2.png?ssl=1)
 * The first problem I encountered is that wc-donation does something with the checkout
   fields (I am using the WooCommerce classic checkout) by which the logic for show
   and hide is mixed.
 * So every time I have to declare the opposite of what I want to accomplish. I.
   e. instead of Hide choose Show, instead of the intended variable subscription
   choose the simple subscription, use “Is in” instead of “Is not in” etc. The condition
   in the picture below states “Hide the address field if the product is in Vriend(
   simple subscription)”, but what it does is that it hides the address field in
   the product Donatie (variable subscription).
 * To exclude that the problem is within the subscription plugin (I use “WooCommerce
   Subscriptions” by WooCommerce) I did the same tests with simple products. But
   the same result.
 * To exclude that the problem is within the checkout field editor, I opened the
   products directly with the product short code ([products ids=”1693″]) and not
   the wc-donation short code ([wcdp_donation_form id=”1693″ style=”3″]). When using
   the product directly the checkout fields work as expected, so no swapped logic.
 * This is also true when using the store instead of the donation forms. So if I
   choose a subscription from the store the conditional fields work as intended.
 * ![](https://i0.wp.com/ncl.nu/temp/4.png?ssl=1)
 * The second problem I encountered is that on first load of variable donation page,
   the conditional checkout fields are not applied and all fields are showing. Refreshing
   the page doesn’t change that and also emptying the cart and going back to the
   donation page doesn’t trigger the conditionality of the checkout fields. However
   if you first select the simple subscription and then go to the variable subscription,
   the conditional checkout fields do work. See this video ( [https://streamable.com/j8c1rq](https://streamable.com/j8c1rq))
   which shows the problem.
 * I contacted the developer of the checkout field manager plugin, but for this 
   problem the same rule applies. When opening the subscriptions directly from the
   store, the conditional checkout fields work as designed. So the problem must 
   be somewhere in the way that wc-donation handles the presentation of the checkout
   fields.
 * Plugins used:
    - Donation Platform for WooCommerce: Crowdfunding & Donatie Management by Jonas
      Höbenreich version 1.3.3
    - Checkout Field Editor and Manager for WooCommerce – Pro by Acowebs version
      4.1.0
    - Loco Translate by Tim Whitlock version 2.6.14
    - WooCommerce by WooCommerce version 9.4.2
    - WooCommerce Subscriptions by WooCommerce version 6.9.0
 *  -  This topic was modified 1 year, 6 months ago by [NCL](https://wordpress.org/support/users/nclnu/).
      Reason: First image not showing
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftwo-problems-with-conditional-checkout-fields%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Jonas](https://wordpress.org/support/users/flinnn/)
 * (@flinnn)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/two-problems-with-conditional-checkout-fields/#post-18170603)
 * Hi NCL,
 * thanks for reaching out.
   I suspect that the problem is that the donation form
   dynamically adds the products to the cart without re-rendering the entire page
   but Checkout Field Editor only changes the checkout input fields when the page
   loads. Can you please check if it works when using style 4?
 * Best,
   Jonas
 *  Thread Starter [NCL](https://wordpress.org/support/users/nclnu/)
 * (@nclnu)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/two-problems-with-conditional-checkout-fields/#post-18171219)
 * Hi Jonas,
 * I changed the simple subscription and the variable subscription form to style
   4 and this solved both problems 🙂 Is there a way in which I can trigger the 
   re-rendering process with the other styles? Because I really like style 1.
 * Kind regards,
   Daniel
 *  Plugin Author [Jonas](https://wordpress.org/support/users/flinnn/)
 * (@flinnn)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/two-problems-with-conditional-checkout-fields/#post-18266714)
 * Hi nclnu,
 * dynamically re-rendering the checkout fields it not easy to implement since it
   would also reset the form and delete all inputs from the user. You could consider
   contacting the developers of your conditional checkout field plugin and request
   them to add support for dynamically applying conditional logic when the cart 
   contents are updated. This feature would make their plugin more compatible with
   dynamic cart updates.
 * Best,
   Jonas

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

The topic ‘Two problems with conditional checkout fields’ is closed to new replies.

 * ![](https://ps.w.org/wc-donation-platform/assets/icon.svg?rev=2611888)
 * [Donation Platform for WooCommerce: Fundraising & Donation Management](https://wordpress.org/plugins/wc-donation-platform/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wc-donation-platform/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wc-donation-platform/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-donation-platform/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-donation-platform/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-donation-platform/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jonas](https://wordpress.org/support/users/flinnn/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/two-problems-with-conditional-checkout-fields/#post-18266714)
 * Status: resolved