Guest User

Untitled

a guest
Jun 18th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <?php
  2.  
  3. function get_total_user_point( $order ) {
  4.  
  5. $user_id = false;
  6. if ( !$order instanceof WC_Order ) {
  7. $order = wc_get_order( $order );
  8. }
  9.  
  10. $user_id = $order->get_user_id();
  11. if( $user_id ){
  12.  
  13. $points = get_user_meta( $user_id , '_ywpar_user_total_points', true );
  14.  
  15. return $points;
  16. }
  17. return '';
  18.  
  19. }
  20.  
  21. echo get_total_user_point( ORDER_ID );
Add Comment
Please, Sign In to add comment