Advertisement
verygoodplugins

Untitled

Jul 24th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1.  
  2. function remove_wpf_actions() {
  3.  
  4.     if ( ! function_exists( 'wp_fusion' ) ) {
  5.         return;
  6.     }
  7.  
  8.     remove_action( 'woocommerce_order_status_processing', array( wp_fusion()->integrations->woocommerce, 'woocommerce_apply_tags_checkout' ) );
  9.     remove_action( 'woocommerce_order_status_completed', array( wp_fusion()->integrations->woocommerce, 'woocommerce_apply_tags_checkout' ) );
  10.  
  11. }
  12.  
  13. add_action( 'plugins_loaded', 'remove_wpf_actions' );
  14.  
  15. function alt_wpf_checkout( $order_id ) {
  16.  
  17.     if ( ! function_exists( 'wp_fusion' ) ) {
  18.         return;
  19.     }
  20.  
  21.     if ( empty( wp_fusion()->batch->process ) ) {
  22.         wp_fusion()->batch->includes();
  23.         wp_fusion()->batch->init();
  24.     }
  25.  
  26.     wp_fusion()->batch->process->push_to_queue( array( 'action' => 'wpf_woocommerce_async_checkout', 'args' => array( $order_id, true ) ) );
  27.     wp_fusion()->batch->process->save()->dispatch();
  28.  
  29. }
  30.  
  31. add_action( 'woocommerce_order_status_processing', 'alt_wpf_checkout' );
  32. add_action( 'woocommerce_order_status_completed', 'alt_wpf_checkout' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement