I am making a plugin where I need checkout form. I am getting below error when I include form-checkout.php
Fatal error: Uncaught Error: Call to a member function is_registration_enabled() on null in C:\xampp7\htdocs\woo\wp-content\plugins\wooinstant\inc\templates\checkout\form-checkout.php:28 Stack trace: #0 C:\xampp7\htdocs\woo\wp-content\plugins\wooinstant\inc\wooinstant-layout.php(19): include() #1 C:\xampp7\htdocs\woo\wp-includes\class-wp-hook.php(286): wooinstant_layout('') #2 C:\xampp7\htdocs\woo\wp-includes\class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #3 C:\xampp7\htdocs\woo\wp-includes\plugin.php(453): WP_Hook->do_action(Array) #4 C:\xampp7\htdocs\woo\wp-includes\general-template.php(2630): do_action('wp_footer') #5 C:\xampp7\htdocs\woo\wp-content\themes\twentyseventeen\footer.php(44): wp_footer() #6 C:\xampp7\htdocs\woo\wp-includes\template.php(688): require_once('C:\xampp7\htdoc...') #7 C:\xampp7\htdocs\woo\wp-includes\template.php(647): load_template('C:\xampp7\htdoc...', true) #8 C:\xampp7\htdocs\woo\wp-includes\general-template.php(76): locate_template(Array, true) #9 C:\xampp7\htdocs\woo\wp-con in C:\xampp7\htdocs\woo\wp-content\plugins\wooinstant\inc\templates\checkout\form-checkout.php on line 28
I want to include checkout form file like this
include plugin_dir_path( __FILE__ ) . '/templates/checkout/form-checkout.php';
I don't want to use [woocommerce_checkout]
there.