Payment Gateway extension, hide/show plugin(extension) settings
-
What is the recommended way to hide/show plugin settings, based on one of the settings dropdown or checkbox values?
What I am attempting to achieve is to hide/show settings based on my payment gateway interaction
mode
iFrame or HostedPaymentPage.The way i have implemented works, but not ideal…
function init_form_fields() { $this->form_fields = include( 'includes/settings-admin-base.php' ); $this->init_settings(); switch ( true ) { case ('HOSTEDPAYMENTPAGE' === $this->get_option( 'ui_mode' ) ) : $this->form_fields = array_merge( include( 'includes/settings-admin-base.php' ), include( 'includes/settings-admin-hpp.php' ) ); break; case ('IFRAME' === $this->get_option( 'ui_mode' ) ) : $this->form_fields = array_merge( include( 'includes/settings-admin-base.php' ), include( 'includes/settings-admin-iframe.php' ) ); break; default: $this->form_fields = include( 'includes/settings-admin-base.php' ); break; } }
I would prefer, to make the setting fields dynamic on change of
interaction mode
dropdown. Right now it requires a save first.Not sure how to manipular the settings fields after
init_settings()
is called.Any help would be greatly appreciated.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Payment Gateway extension, hide/show plugin(extension) settings’ is closed to new replies.