<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>Woocommmerce issue

[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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer