• Resolved sanil7

    (@sanil7)


    Hello, I have been using this hook to change the default Woocommerce order status and it works perfectly but once I replace the default thank you page with the custom thank you page using woolentor template builder, the function starts working. Can someone help me?

    add_action( 'woocommerce_thankyou', 'woocommerce_thankyou_change_order_status', 10, 1 );
    function woocommerce_thankyou_change_order_status( $order_id ){
        if( ! $order_id ) return;
    
        $order = wc_get_order( $order_id );
    
        if( $order->get_status() == 'processing' )
            $order->update_status( 'pending' );
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Tarek Aziz

    (@tarekht)

    Hello @sanil7

    Thank you very much for reaching out to us ??

    I have thoroughly read your message and based on that (your message) everything seems to be working properly.

    Could you please elaborate on what exactly the issue is? I’ll highly appreciate it.

    Kind regards,
    Tarek

    Thread Starter sanil7

    (@sanil7)

    add_action( 'woocommerce_thankyou', 'woocommerce_thankyou_change_order_status', 10, 1 );
    function woocommerce_thankyou_change_order_status( $order_id ){
        if( ! $order_id ) return;
    
        $order = wc_get_order( $order_id );
    
        if( $order->get_status() == 'processing' )
            $order->update_status( 'pending' );
    }

    This above mentioned snippet only works for default Thank You Page but the snippet does not work after creating a custom thank you page using woolentor template builder.

    Plugin Contributor Tarek Aziz

    (@tarekht)

    Thanks a lot for the clarification ??

    Could you please increase the priority in the following line?

    add_action( 'woocommerce_thankyou', 'woocommerce_thankyou_change_order_status', 10, 1 );

    Try increasing it to a number that is more than 10

    Hopefully, it will resolve the issue. If it doesn’t work as expected, would you please contact us through our support website?

    https://woolentor.com/contact/

    Our support team will definitely assist you with this.

    Best regards,
    Tarek

    • This reply was modified 2 years, 1 month ago by Tarek Aziz.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hook to Custom Thank You Page’ is closed to new replies.