verygoodplugins

Untitled

Jan 12th, 2021 (edited)
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. function wpf_only_allow_completed( $order_data, $order ) {
  2.  
  3.     // Only sync the order details if the order status is completed OR if the customer already has the tag MY TAG NAME
  4.  
  5.     if ( 'completed' == $order->get_status() || wpf_has_tag( 'MY TAG NAME', $order->get_user_id() ) ) {
  6.         return $order_data;
  7.     } else {
  8.         return null;
  9.     }
  10.  
  11. }
  12.  
  13. add_filter( 'wpf_woocommerce_customer_data', 'wpf_only_allow_completed', 10, 2 );
Add Comment
Please, Sign In to add comment