Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ashanna

    (@morki)

    Hello,

    You need to write the hook like this, as you are inside the class :
    add_action( 'woocommerce_order_status_completed', array($this, 'add_booking_details_to_db') );

    Although, I don’t know exactly what you want to do, but you might not need to put your code inside the plugin itself (it will be erased in the next update). You could just add it to your theme’s functions.php.

    Thread Starter irfandayan

    (@irfandayan)

    Thank you very much.

    I got it solved. I did the same way you mentioned but used different woo-commerce hook.

    add_action( 'woocommerce_payment_complete', array($this, 'add_booking_details_to_db'));
    
    public function add_booking_details_to_db($order_id) {...}

    I wanted some customized database update after payment completed and this hook worked for me.

    Is there automatic updates installed for this plugin?

    Much appreciated your response.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add Woo-commerce hook woocommerce_order_status_completed’ is closed to new replies.