• Hi
    Hope you’re doing . i am running digital download shop with woocommerce , i am looking for a solution that’s auto approve processing Orders .
    i tried with wp_schedule_event but i fail.

    global $woocommerce;
    $order = new WC_Order($customer_order->ID);

    $_payment_method=get_post_meta($order->id, ‘_payment_method’, true );

    if( $_payment_method == ‘twocheckout-woocommerce’ && $order->status == ‘processing’){

    if ( count( $order->get_items() ) > 0 ) {
    $order->update_status(‘completed’);
    }

    }

    I’m getting a error.

    Fatal error: Uncaught Error: Call to a member function get_items() on boolean in /var/www/edatastyle/wp-content/plugins/woocommerce/includes/wc-order-functions.php:486 Stack trace: #0 /var/www/edatastyle/wp-includes/plugin.php(524): wc_downloadable_product_permissions(548) #1 /var/www/edatastyle/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(2390): do_action(‘woocommerce_ord…’, 548) #2 /var/www/edatastyle/wp-content/themes/edatastyle/functions.php(746): WC_Abstract_Order->update_status(‘completed’) #3 /var/www/edatastyle/wp-settings.php(387): include(‘/var/www/edatas…’) #4 /var/www/edatastyle/wp-config.php(92): require_once(‘/var/www/edatas…’) #5 /var/www/edatastyle/wp-load.php(39): require_once(‘/var/www/edatas…’) #6 /var/www/edatastyle/wp-blog-header.php(13): require_once(‘/var/www/edatas…’) #7 /var/www/edatastyle/index.php(17): require(‘/var/www/edatas…’) #8 {main} thrown in /var/www/edatastyle/wp-content/plugins/woocommerce/includes/wc-order-functions.php on line 486

    Does anyone know how to fix it?

    With kind regards,
    Saiful

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to auto approve processing Orders’ is closed to new replies.