• Resolved divyanshu1234

    (@divyanshu1234)


    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.

Viewing 1 replies (of 1 total)
  • Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @divyanshu1234

    If you feel you have found a bug within the free WooCommerce plugin within the wc_get_order function you can report that bug on the official WooCommerce Github issues board below. When submitting a bug report include as much information as you can detailing what the issue is and how our developers can replicate that.

    https://github.com/woocommerce/woocommerce/issues/new?assignees=&labels=&template=1-bug-report.yml

    As the free WooCommerce plugin is open source, anyone can contribute to the plugin including highlighting potential bug reports. The developers of WooCommerce will review your bug report. If found to be an issue within the free WooCommerce plugin the developers will address that within a future update to the plugin.

    Thanks for taking the time to contribute to the WooCommerce plugin and the open-source community. in general.

Viewing 1 replies (of 1 total)

The topic ‘Woocommmerce issue’ is closed to new replies.