M
M
Maxim2021-12-30 13:00:38
PHP
Maxim, 2021-12-30 13:00:38

How to execute require get_theme_file_path when certain checkbox is selected?

Greetings.
There is a checkbox on the checkout page,
provided that the checkbox is selected, you need to execute
require get_theme_file_path( 'inc/return-options.php' );
took as a basis

add_action( 'woocommerce_checkout_process', 'return_activation' );
function return_activation() {
  if ( ! (int) isset( $_POST['custom_fee'] ) ) {
            	}
                     else {
          require get_theme_file_path( 'inc/return-options.php' );
}
}


It just doesn't work :(

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question