[ad_1]
Replies: 1
Hello team,
We are using the wc_get_order function in order to receive the order data. But, it is returning false.
This is because the get_class_name_for_order_id() function in get_order function(mentioned below) of the woocommerce repository returns false.
public static function get_order( $order_id = false ) {
$order_id = self::get_order_id( $order_id );
if ( ! $order_id ) {
return false;
}
$classname = self::get_class_name_for_order_id( $order_id );
if ( ! $classname ) {
return false;
}
try {
return new $classname( $order_id );
} catch ( Exception $e ) {
wc_caught_exception( $e, __FUNCTION__, array( $order_id ) );
return false;
}
}
We have checked and the $order_id is coming correct. Need to know why valid $classname is not returned.
Need your help regarding this.
