• Resolved benoitdim

    (@benoitdim)


    hello

    i have added this hook

    /**
     * Auto Complete all WooCommerce orders.
     */
    
    function custom_woocommerce_auto_complete_order( $order_id ) { 
        if ( ! $order_id ) {
            return;
        }
    
        $order = wc_get_order( $order_id );
        $order->update_status( 'completed' );
    }
    add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );

    Sometimes the function woocommerce_thankyou is not called, but sometimes works fine

    thx

Viewing 5 replies - 1 through 5 (of 5 total)
  • Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    Hi @benoitdim,

    Can you provide additional context here?

    woocommerce_thankyou is always called when an order has been successfully been placed. Under what conditions are you seeing that it is not being called?

    Thread Starter benoitdim

    (@benoitdim)

    hello

    i can not find a condition :S

    more info :

    i only have one product to sell ( licence )
    customer never create an account,
    i use also this plugin : https://woocommerce.com/products/woocommerce-one-page-checkout/

    the order stay in “Processing” status

    maybe i could modify code, to have more log, to know what happen ???
    or look somewhere log ???

    Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    Hi @benoitdim,

    Since the One Page Checkout is a premium extension, if you have a valid subscription for that extension, please head over here and open a ticket WooCommerce.com > My Account > Tickets

    Thread Starter benoitdim

    (@benoitdim)

    i can not send ticket :

    System Status Report is invalid or unsupported

    Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    @benoitdim,

    You can find your System Status Report by going to “WooCommerce → Status” in your site’s WP-Admin.

    Click on “Get system report” and then “Copy for support”. Once you’ve done that, paste it in the space provided for it.

    I’ll go ahead and mark this thread as resolved now.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Sometimes the function woocommerce_thankyou is not called’ is closed to new replies.