there is a class "CUSTOM_WC_REST_Orders_Controller" called in a plugin like that:
add_action('woocommerce_init', 'woocommerce_mstore_init');
function woocommerce_mstore_init()
{
include_once plugin_dir_path(__FILE__) . "controllers/flutter-order.php";
}
while in that flutter-order.php the code is
class CUSTOM_WC_REST_Orders_Controller extends WC_REST_Orders_Controller
{
bla bla bla
function create_new_order($request)
{
bla bla bla
}
}
new CUSTOM_WC_REST_Orders_Controller();
in my custom plugin I have tried to do this ( but it's not working at all )
add_action('woocommerce_init', 'hmp_custom_woocommerce_mstore_init', 999);
function hmp_custom_woocommerce_mstore_init(){
if (!class_exists('CUSTOM_WC_REST_Orders_Controller') ) {
return;
}
class hmp_CUSTOM_WC_REST_Orders_Controller extends CUSTOM_WC_REST_Orders_Controller
{
function create_new_order($request)
{
return("test44");
}