Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wfocu_remove_drip_actions() {
- if ( class_exists( 'WC_Drip_Events' ) ) {
- $drip_event = WC_Drip_Events::get_instance();
- remove_action( 'woocommerce_payment_complete', array( $drip_event, 'new_order' ) );
- add_action( 'woocommerce_thankyou', 'wfocu_run_drip_on_thankyou', 10, 1 );
- }
- }
- function wfocu_run_drip_on_thankyou( $order_id ) {
- $order = wc_get_order( $order_id );
- if ( class_exists( 'WC_Drip_Events' ) && $order->has_status( wc_get_is_paid_statuses() ) ) {
- $drip_event = WC_Drip_Events::get_instance();
- $drip_event->new_order( $order_id );
- }
- }
- add_action( 'wp', 'wfocu_remove_drip_actions', 999 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement