Answer the question
In order to leave comments, you need to log in
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' );
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question