Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 130709

Change checkout fields based on payment gateway

$
0
0

Replies: 0

First, I’m continually amazed at how well WooCommerce has been designed – simply amazing. Well done!

I’d like to hide/show checkout fields based on the selected payment gateway (e.g. if paying by check, show/hide certain checkout fields and if paying by PayPal, show/hide certain checkout fields). I need checkout field visibility to change dynamically when the user toggles selected payment methods at checkout.

I understand the basic mechanics, since for other purposes, I am already using
add_filter( 'woocommerce_checkout_fields' , ... );
add_action( 'woocommerce_cart_calculate_fees', ... );
and I am already triggering ‘update_checkout’ via a script when the payment_method changes, so that cart fees are recalculated when the payment method changes.

Do I modify the ‘woocommerce_checkout_fields’ filter (based on payment method) and refresh the checkout fields with another script? A few suggestions or an example would be greatly appreciated.

Thank you!


Viewing all articles
Browse latest Browse all 130709

Trending Articles