Guest User

Untitled

a guest
Aug 1st, 2015
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. function custom_process_order($user_id) {
  2.    
  3.     global $woocommerce;
  4.         $order = wc_get_order($order_id);
  5.  
  6.     $amount = intval($order->get_total());
  7.     $funds = get_user_meta( $user_id, 'account_funds', true );
  8.     $funds = $funds ? $funds : 0;
  9.     $funds += floatval( $amount );
  10.     update_user_meta( $user_id, 'account_funds', $funds );
  11.    
  12. }
Advertisement
Add Comment
Please, Sign In to add comment